(2260) : warning 235: public function lacks forward declaration (symbol "OnPlayerShootPlayer")
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost) {
!strcmp(cmd, "/engine", true) == 0
forward OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost); // place this anywhere you want, but it should be before the callback
OnPlayerShootPlayer() callback requires a forward declaration.
PHP код:
|
Yes, but he's trying to use the OnPlayerShootPlayer include.
https://sampforum.blast.hk/showthread.php?pid=937824#pid937824 |
OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
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. |
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; }
if(!strcmp(cmd, "/engine", true) ==0 || strcmp(cmd, "/e", true))
if(!strcmp(cmd, "/engine", true) || !strcmp(cmd, "/e", true))
Originally Posted by iZN
yes I know, and I forgot to mention, why the OP even needs this include? when there's this:
Код:
OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) |
pawn Код:
And you need to do the same in the second strcmp as well. pawn Код:
|