Always shows usage? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Always shows usage? (
/showthread.php?tid=134827)
Always shows usage? -
Torran - 17.03.2010
Hello,
I dont normally do it this way, This is my first time, Ive hit a problem,
pawn Код:
CMD:setlevel(playerid, params[])
{
new tmp[128], tmp2[128], index;
tmp = strtok(params, index), tmp2 = strtok(params, index);
new giveplayerid, level;
giveplayerid = strval(tmp), level = strval(tmp2);
if(PlayerInfo[playerid][AdminLevel] > 4 || IsPlayerAdmin(playerid)) {
if(!strval(params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /setlevel [PlayerID/PartOfName] [Level]");
if(!strval(tmp)) return SendClientMessage(playerid, COLOR_RED, "Usage: /setlevel [PlayerID/PartOfName] [Level]");
if(!strval(tmp2)) return SendClientMessage(playerid, COLOR_RED, "Usage: /setlevel [PlayerID/PartOfName] [Level]");
if(IsPlayerConnected(giveplayerid)) {
print("Setlevel command");
PlayerInfo[giveplayerid][AdminLevel] = level;
}
else return SendClientMessage(playerid, COLOR_RED, "Player not Connected");
}
else return SendClientMessage(playerid, COLOR_RED, "You are not an administrator with the required level");
return 1;
}
Ingame if i type /setlevel, Nothing happens
If i type /setlevel 0, it sends usage
If i type /setlevel 0 5, it sends usage
Whats wrong?
Re: Always shows usage? -
aircombat - 17.03.2010
idk about zcmd but u can try my topic , i had the same problem and Saif helped me
http://forum.sa-mp.com/index.php?topic=160080.0
Re: Always shows usage? -
Torran - 17.03.2010
Lol yeah that was a cmdtext problem but im using zcmd...
Re: Always shows usage? -
Torran - 18.03.2010
Bump
sorry misjudged the times