Help please. QUestion.
#1

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.
Reply
#2

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...
Reply
#3

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)