GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: RedBull - 2013. Július 18. - 15:07:17

Cím: Parancs
Írta: RedBull - 2013. Július 18. - 15:07:17
Hy! Hogy tudom megcsinálni azt, hogy csakk akkor tudjam használni a /help parancsot ha van 1Scorem?  :confused:
Cím: Parancs
Írta: Flash - 2013. Július 18. - 15:36:27
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;
}
Cím: Parancs
Írta: kamionos - 2013. Július 18. - 16:10:29
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
Cím: Parancs
Írta: RedBull - 2013. Július 18. - 16:21:49
és ha 10scretól mûködjön?
Akkor 1-10 között legyen a pontom azt hogy? :)
Cím: Parancs
Írta: kamionos - 2013. Július 18. - 16:27:48
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
Cím: Parancs
Írta: SnooP - 2013. Július 18. - 16:35:02
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  :)
Cím: Parancs
Írta: Flash - 2013. Július 18. - 16:47:03
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
Cím: Parancs
Írta: RedBull - 2013. Július 18. - 19:10:41
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.
Cím: Parancs
Írta: Flash - 2013. Július 18. - 19:13:06
Én ebbe nem látok hibát..
Melyik a 174-175. sor?
Cím: Parancs
Írta: RedBull - 2013. Július 18. - 19:27:55
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);
Cím: Parancs
Írta: SnooP - 2013. Július 18. - 19:33:37

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 ;)