Help please. QUestion. - 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)
+--- Thread: Help please. QUestion. (
/showthread.php?tid=360325)
Help please. QUestion. -
PhoeNiX778 - 17.07.2012
Hello guys, if I type a cmd begining with W like /wdasdsa, /weatherall, /wfdsfs etc. I receive /weaponid [id]
Here is the script involved with /weaponid:
Код:
if(strcmp(cmd, "/weaponid", true) == 1)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " your no authorized to use that command . ");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /weaponid [id]");
return 1;
}
new playa;
playa = strval(tmp);
SendClientMessage(playerid, COLOR_GRAD1, "User online:");
foreach (Player, i)
{
if(GetPVarInt(i, "PlayerLogged") == 1)
{
if(GetPlayerWeapon(i) == playa)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "** ID: %d ** %s", i, sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
}
}
return 1;
}
I'm really confused. If you can help me I'll be very happy, thank you all in advance.
Re: Help please. QUestion. -
Andi_Evandy - 17.07.2012
pawn Код:
if(strcmp(cmd, "/weaponid", true) == 1) //if stringcompare the "cmd" with "/weaponid" is not the same, then...
change it to:
pawn Код:
if(strcmp(cmd, "/weaponid", true) == 0)//if stringcompare the "cmd" with "/weaponid" is the same, then...
Re: Help please. QUestion. -
PhoeNiX778 - 17.07.2012
Thank you.