Playerid
#1

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

pawn Код:
if(IsACop(playerid))//On this line is error
There is no playerid given by this public.
Change playerid into either Shooter or Target.
Reply
#3

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);
Reply
#4

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:
pawn Код:
if(IsACop(Shooter))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)