How to make car drivable only with one skin
#1

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

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;
}
Reply
#3

if ( !GetPlayerSkin(playerid) == 27 )

Should be:

if ( GetPlayerSkin(playerid) != 27 )
Reply
#4

Yea, I maked a mistake
Reply
#5

İ tested it aint working?
Reply
#6

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

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.
Reply
#8

İ 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
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)