SA-MP Forums Archive
How to make car drivable only with one skin - 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: How to make car drivable only with one skin (/showthread.php?tid=293570)



How to make car drivable only with one skin - Artie_Scorpion - 29.10.2011

Hi i want to know how to make car drivable which id is: 428 drivable for only skin which id is 27
If player will enter this car without skin: 27 then he will get ejected


Re: How to make car drivable only with one skin - Pinguinn - 29.10.2011

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new model = GetVehicleModel(vehicleid);
    if(model == 428)
    {
        if(!GetPlayerSkin(playerid) == 27) return SendClientMessage(playerid, -1, "You are not allowed to drive this car");        
    }
    return 1;
}



Re: How to make car drivable only with one skin - SmiT - 29.10.2011

if ( !GetPlayerSkin(playerid) == 27 )

Should be:

if ( GetPlayerSkin(playerid) != 27 )


Re: How to make car drivable only with one skin - Pinguinn - 29.10.2011

Yea, I maked a mistake


Re: How to make car drivable only with one skin - lordturhan - 29.10.2011

İ tested it aint working?


Re: How to make car drivable only with one skin - park4bmx - 29.10.2011

so if the player dont ahve skin 27 he canot drive the vehicle si that right ?


Re: How to make car drivable only with one skin - FUNExtreme - 29.10.2011

Quote:
Originally Posted by Pinguinn
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new model = GetVehicleModel(vehicleid);
    if(model == 428)
    {
        if(!GetPlayerSkin(playerid) == 27) return SendClientMessage(playerid, -1, "You are not allowed to drive this car");        
    }
    return 1;
}
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new model = GetVehicleModel(vehicleid);
    if(model == 428)
    {
        if(GetPlayerSkin(playerid) != 27) return SendClientMessage(playerid, -1, "You are not allowed to drive this car");         
    }
    return 1;
}
Your question was answered and it works.


Re: How to make car drivable only with one skin - lordturhan - 29.10.2011

İ just go ingame and it didnt worked it aint removing player from vehicle.

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new model = GetVehicleModel(vehicleid);
    if(model == 428)
    {
        if(!GetPlayerSkin(playerid) != 27) return SendClientMessage(playerid, -1, "You are not allowed to drive this car");        
    }
    return 1;
}
Your question was answered and it works.
Код:
TESTGM.pwn(125) : warning 213: tag mismatch



Re: How to make car drivable only with one skin - park4bmx - 29.10.2011

Quote:
Originally Posted by lordturhan
Посмотреть сообщение
İ just go ingame and it didnt worked it aint removing player from vehicle.
does it show the message ?


Re: How to make car drivable only with one skin - lordturhan - 29.10.2011

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
does it show the message ?
Yes but aint removing player from vehicle i tryed to improve it a bit but i couldnt manage to make it worked.

pawn Код:
{
    new model = GetVehicleModel(vehicleid);
    if(model == 470||432||433)
    {
    if (GetPlayerSkin(playerid) != 287 ) return SendClientMessage(playerid, -1, "[Server]:Only Army Members Can Drive This Vehicle")|| RemovePlayerFromVehicle(playerid);
    }
    return 1;
}