Playerid - 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: Playerid (
/showthread.php?tid=316717)
Playerid -
Alex.Cone - 08.02.2012
Hello there.
I have this errors on this lines :
Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
if(IsACop(playerid))//On this line is error
{
if(GetPlayerWeapon(Shooter) == 23)
{
TogglePlayerControllable(Target, false);
ApplyAnimation(Target,"CRACK","crckdeth2",4.1,1,1,1,1,1);
pTazed[Target] = 1;
SetTimerEx("Tazed", 10000, 0, "d", Target);
SendClientMessage(Target, 0xFF0000FF, "You've been tazed for 10 seconds!");
}
}
return 1;
}
And this is that erorr
Код:
C:\Documents and Settings\Medion\Desktop\Country life\GTARP\gamemodes\gtarp.pwn(44488) : error 017: undefined symbol "playerid"
Re: Playerid -
DutchApproach - 08.02.2012
pawn Код:
if(IsACop(playerid))//On this line is error
There is no playerid given by this public.
Change playerid into either Shooter or Target.
Re : Playerid -
ricardo178 - 08.02.2012
Replace this line:
pawn Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
With:
pawn Код:
public OnPlayerShootPlayer(playerid, Shooter,Target,Float:HealthLost,Float:ArmourLost)
And the forward(If there is one) with:
pawn Код:
forward OnPlayerShotPlayer(playerid, Shooter, Target, Float:HealthLost, Float:ArmourLost);
Re: Playerid -
SVRP - 08.02.2012
Ricardo, that doesn't make sense.
The playerid is either the shooter or the target. If it isn't any of them, the function won't be called.
The error-line should be replaced with: