Szerző Téma: Parancs  (Megtekintve 863 alkalommal)

Parancs
« Dátum: 2013. Július 18. - 15:07:17 »
0 Show voters
Hy! Hogy tudom megcsinálni azt, hogy csakk akkor tudjam használni a /help parancsot ha van 1Scorem?  :confused:

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Parancs
« Válasz #1 Dátum: 2013. Július 18. - 15:36:27 »
0 Show voters
CMD:help(playerid) {
if(GetPlayerScore(playerid) < 1)) return SendClientMessage(playerid, -1, \"Hiba.. minimum 1 pontodnak kell lennie a parancs használatához!\");
// ide amit csináljon..
return 1;
}

Parancs
« Válasz #2 Dátum: 2013. Július 18. - 16:10:29 »
0 Show voters
Idézetet írta: Flash date=1374154587\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"39986\" data-ipsquote-contentclass=\"forums_Topic

CMD:help(playerid) {
if(GetPlayerScore(playerid) < 1)) return SendClientMessage(playerid, -1, \"Hiba.. minimum 1 pontodnak kell lennie a parancs használatához!\");
// ide amit csináljon..
return 1;
}

 

persze ha ZCMD-s  mód

Parancs
« Válasz #3 Dátum: 2013. Július 18. - 16:21:49 »
0 Show voters
és ha 10scretól mûködjön?
Akkor 1-10 között legyen a pontom azt hogy? :)

Parancs
« Válasz #4 Dátum: 2013. Július 18. - 16:27:48 »
0 Show voters
egyszerû
Amit flash leírt csak annyi hogy azt 1-t átirod 10-re igy e:
 
CMD:help(playerid) {
        if(GetPlayerScore(playerid) < 10)) return SendClientMessage(playerid, -1, \"Hiba.. minimum 10 pontodnak kell lennie a parancs használatához!\");
        // ide amit csináljon..
        return 1;
}

 
Itt már 10 ponttól tudsz parancsot használni

Nem elérhető SnooP

  • 1798
  • SnooP
    • Profil megtekintése
Parancs
« Válasz #5 Dátum: 2013. Július 18. - 16:35:02 »
+1 Show voters
Nem egyszerûbb azt lekérdezni, hogy a játékos pontja 10, mint azt, hogy  a játékos pontja nagyobb-e egynél és kisebb 10-nél ? ?
Amit te gondolsz az így lenne:
 

CMD:help(playerid) {
          if(1<GetPlayerScore(playerid)<10) return SendClientMessage(playerid, -1, \"A pontod sajnos kisebb mint 10.\"); //
        // ide amit csináljon..
        return 1;
}

 
És ahogy egyszerûbb és jobb megoldás:
 

CMD:help(playerid) {
        if(GetPlayerScore(playerid) < 10)) return SendClientMessage(playerid, -1, \"Sajnálom a te pontod kisebb mint 10.\");
        // ide amit csináljon..
        return 1;
}

 
Remélem látod és érted a külnöbséget  :)

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Parancs
« Válasz #6 Dátum: 2013. Július 18. - 16:47:03 »
+1 Show voters
Minek ezt bonyolítani??
Gondolom érthetõ a   GetPlayerScore(playerid) < 10
                                   Ha a játékos potjainak az összege kissebb mint tíz..
vagy..
                                 GetPlayerScore(playerid) <= 9
                                 Vagyis ha a játékos pontjainak az összege kissebb vagy egyenlõ a 9-el

Parancs
« Válasz #7 Dátum: 2013. Július 18. - 19:10:41 »
0 Show voters
Itt van! De erroros :(
 
   if (strcmp(\"/munka\", cmdtext, true, 10) == 0)
{
        if(GetPlayerScore(playerid) < 1)) return SendClientMessage(playerid, 0xAA3333AA, \"Hiba.. minimum 1 pontodnak kell lennie a parancs használatához!\");
        SetPlayerPos(playerid,-1988.2336,178.8083,27.5391);
return 1;
}

 

C:\\Games\\XY\\filterscripts\\XY.pwn(174) : error 029: invalid expression, assumed zero
C:\\Games\\NST\\filterscripts\\XY.pwn(174) : warning 215: expression has no effect
C:\\Games\\NST\\filterscripts\\XY.pwn(174) : error 001: expected token: \";\", but found \"return\"
C:\\Games\\NST\\filterscripts\\XY.pwn(175) : warning 225: unreachable code
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
2 Errors.

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Parancs
« Válasz #8 Dátum: 2013. Július 18. - 19:13:06 »
+1 Show voters
Én ebbe nem látok hibát..
Melyik a 174-175. sor?

Parancs
« Válasz #9 Dátum: 2013. Július 18. - 19:27:55 »
0 Show voters
Ezek:
 
 if(GetPlayerScore(playerid) < 1)) return SendClientMessage(playerid, 0xAA3333AA, \"Hiba.. minimum 1 pontodnak kell lennie a parancs használatához!\");
        SetPlayerPos(playerid,-1988.2336,178.8083,27.5391);

Nem elérhető SnooP

  • 1798
  • SnooP
    • Profil megtekintése
Parancs
« Válasz #10 Dátum: 2013. Július 18. - 19:33:37 »
+1 Show voters

if(GetPlayerScore(playerid) < 1) return SendClientMessage(playerid, 0xAA3333AA, \"Hiba.. minimum 1 pontodnak kell lennie a parancs használatához!\");
        SetPlayerPos(playerid,-1988.2336,178.8083,27.5391);

 
Aki írta kettõ zárójelt rakott ki egy helyett, így már megy ;)

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal