Another IsACopCar
#1

Quote:

public IsACopCar(carid)
{

new model = GetVehicleModel(GetPlayerVehicleID(playerid));
if (model == 425||model == 527||model == 520||model == 497||model == 470||model == 432||model == 428||model == 427||model == 423||model >= 596 && model <=599||model == 601)
{
return 1;
}
return 0;
}

Quote:

gf.pwn(2493) : error 017: undefined symbol "playerid"

Anyone ?
Reply
#2

Or use a loop, or make the public like: " public IsACopCar(carid, playerid) "
Reply
#3

How can i make a loop ?

When I make

public IsACopCar(carid, playerid)

I recive

gf.pwn(2490) : error 025: function heading differs from prototype
Reply
#4

Change the forward to forward IsACopCar(carid, playerid) aswell

Loop:
pawn Код:
public IsACopCar(carid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        new model = GetVehicleModel(GetPlayerVehicleID(i));
        if (model == 425||model == 527||model == 520||model == 497||model == 470||model == 432||model == 428||model == 427||model == 423||model >= 596 && model <=599||model == 601) return 1;
    }
    return 0;
}
Reply
#5

Just use the loop way. It'll be easier for you, since you can copy paste it -_-
Reply
#6

Doesn't work with a loop, another ideea to make isacopcar with car model, NO with car id
Reply
#7

pawn Код:
stock IsCopCar(playerid)
{
    switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
    {
        case 425, 427, 520: return 1; // Add the rest of the cop vehicles separated by a ,
    }
    return 0;
}
Reply
#8

pawn Код:
public IsACopCar(carid)
{

new model = GetVehicleModel(carid);
if (model == 425||model == 527||model == 520||model == 497||model == 470||model == 432||model == 428||model == 427||model == 423||model >= 596 && model <=599||model == 601)
{
return 1;
}
return 0;
}
But you will need to use something like this: IsCopCar(GetPlayerVehicleID(playerid));
Reply
#9

pawn Код:
stock IsACopCar( vehicleid )
{
    switch ( GetVehicleModel( vehicleid ) )
    {
        case 425, 527, 520, 497, 470, 432, 428, 427, 423, 596 .. 599, 601 :
        return 1;
    }
   
    return 0;
}

// Example:
if ( IsACopCar( GetPlayerVehicleID( playerid ) )
    Ban( playerid );
Well, this is a simplified version of Farsek's.
Reply
#10

No-one work ... WHY ?
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)