RemovePlayerFromVehicle Help!!
#1

Solved! Thanks alot xFlawLess
Reply
#2

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
pawn Код:
if(GetVehicleModel(vehicleid) == 469 || 447 || 563)
    {
        if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
        {
            if(gTeam[playerid] == TEAM_IN || TEAM_EUS )
            {
                SendClientMessage(playerid, 0xFF0000AA, "You're not allowed to drive this vehicle!");
                RemovePlayerFromVehicle(playerid);
            }
        }
    }
I am using this code Under OnPlayerEnterVehicle and does'nt do anything. The same reaction is there when i use it OnPlayerStateChange??

I want the function to check if the Vehicle Model is 469 then check is player's state is Driver? and is the player member of TEAM_IN Or Team_US. Then Remove him from the vehicle with the SendClientMessage!

Can somebody please tell me whats wrong? can you correct me the code and where to use it?
PS
Will rep everyone who will help!
Use it at OnPlayerStateChange()

pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 469 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 447 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 563)
    {
        if(gTeam[playerid] == TEAM_IN || gTeam[playerid] == TEAM_EUS )
        {
            SendClientMessage(playerid, 0xFF0000AA, "You're not allowed to drive this vehicle!");
            RemovePlayerFromVehicle(playerid);
        }
    }
}
Reply
#3

pawn Код:
if(GetVehicleModel(vehicleid) == 469 || GetVehicleModel(vehicleid) == 447 || GetVehicleModel(vehicleid) == 563)
    {
        if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
        {
            if(gTeam[playerid] == TEAM_IN || gTeam[playerid] == TEAM_EUS )
            {
                SendClientMessage(playerid, 0xFF0000AA, "You're not allowed to drive this vehicle!");
                RemovePlayerFromVehicle(playerid);
            }
        }
    }
try this
Reply
#4

Quote:
Originally Posted by XFlawless
Посмотреть сообщение
Use it at OnPlayerStateChange()

pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 469 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 447 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 563)
    {
        if(gTeam[playerid] == TEAM_IN || gTeam[playerid] == TEAM_EUS )
        {
            SendClientMessage(playerid, 0xFF0000AA, "You're not allowed to drive this vehicle!");
            RemovePlayerFromVehicle(playerid);
        }
    }
}
Worked! Thanks alot brother. [Rep+]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)