fixing a command - 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: fixing a command (
/showthread.php?tid=130118)
fixing a command -
aircombat - 25.02.2010
i made /suspect but problem is when player type a wrong command it shows Unknown Command but it shows you aren't from lspd plz take a look :
Код:
if(strcmp(cmd,"/suspect", true) == 0)
{
if(GetPlayerSkin(playerid) != 288) return SendClientMessage(playerid, 0xE3E3E3FF, "ERROR: You are not part of the LSP");
new giveplayerid;
tmp = strtok(cmdtext, idx);
SendClientMessage(playerid, 0xE3E3E3FF, "USAGE: /suspect [playerid]");
giveplayerid = strval(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, 0xE3E3E3FF, "ERROR: Player not Conected!");
{
SendClientMessage(playerid, 0xE3E3E3FF, "Done!");
SetPlayerColor(giveplayerid,0xFF8000FF);
}
return 1;
}
________
Vaporizer Volcano
Re: fixing a command -
silvan - 25.02.2010
Try this:
Код:
if(strcmp(cmd,"/suspect", true) == 0)
{
if(GetPlayerSkin(playerid) != 288)
{
SendClientMessage(playerid, 0xE3E3E3FF, "ERROR: You are not part of the LSP");
return 1;
}
new giveplayerid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xE3E3E3FF, "USAGE: /suspect [playerid]");
return 1;
}
giveplayerid = strval(tmp);
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid, 0xE3E3E3FF, "ERROR: Player not Conected!");
return 1;
}
SendClientMessage(playerid, 0xE3E3E3FF, "Done!");
SetPlayerColor(giveplayerid,0xFF8000FF);
return 1;
}