SA-MP Forums Archive
Another IsACopCar - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Another IsACopCar (/showthread.php?tid=261688)



Another IsACopCar - cotyzor - 14.06.2011

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 ?


Re: Another IsACopCar - Wesley221 - 14.06.2011

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


Re: Another IsACopCar - cotyzor - 14.06.2011

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


Re: Another IsACopCar - Wesley221 - 14.06.2011

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;
}



Re: Another IsACopCar - Steven82 - 14.06.2011

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


Re: Another IsACopCar - cotyzor - 15.06.2011

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


Re: Another IsACopCar - [L3th4l] - 15.06.2011

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;
}



Re: Another IsACopCar - Farsek - 15.06.2011

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));


Re: Another IsACopCar - Basicz - 15.06.2011

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.


Re: Another IsACopCar - cotyzor - 19.06.2011

No-one work ... WHY ?