29.03.2015, 09:53
Quote:
pawn Код:
Either just have !strcmp or == 0, not both. And the second "|| strcmp" check's if it does not return 0, since you don't have ! or == 0. Therefore your command will trigger if you use /engine or anything other than /e. So you need to put ! or == 0 with the second as well. (Note: Strcmp returns 0 if you entered the string, /engine or /e, but it return 1 or -1 if you did not.) OnPlayerShootPlayer requires the OPSP (OnPlayerShootPlayer) include. |
and i have more bug in /tazer
the command give me gun but the gun isn't give tazer.
the code:
Код HTML:
if(strcmp(cmd, "/tazer", true) ==0 || strcmp(cmd, "/ta", true) ==0) { if(IsPlayerConnected(playerid)) { if(IsACop(playerid)) { new Ammo = GetPlayerAmmo(playerid); if(Ammo < 0) return 1; if(GetPlayerWeapon(playerid)==24) { AC_RemovePlayerWeapon(playerid, 24); AC_GivePlayerWeapon(playerid,23,Ammo); format(string, sizeof(string), "* %s unholsters his/her tazer.", sendername); ProxDetector(30.0, playerid, string, COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE); } else if(GetPlayerWeapon(playerid)==23) { AC_RemovePlayerWeapon(playerid, 23); AC_GivePlayerWeapon(playerid,24,Ammo); format(string, sizeof(string), "* %s holsters his/her tazer.", sendername); ProxDetector(30.0, playerid, string, COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE,COLOR_SKYBLUE); } } else return SendClientMessage(playerid, COLOR_GREY, "You are not a Cop!"); } return 1; }