11.01.2010, 11:50
how to make a player enter only as a passenger in to a vehicle?
public OnPlayerStateChange(playerid,newstate,oldstate) { new string[100]; format(string, sizeof(string), "You entered the vehicle!",1,6); SendClientMessage(playerid,0xFFFFFFFF,string); return 1; }
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { if(( gTeam[playerid] == TEAM_CIVIL) && (GetVehicleModel(GetPlayerVehicleID(playerid)) == 598)) { RemovePlayerFromVehicle(playerid); SetPlayerWantedLevel( playerid, GetPlayerWantedLevel( playerid )+1 ); GameTextForPlayer(playerid, "~r~This vehicle belongs to L.V.P.D.", 3500, 3); } } return 1; }
new trainticket[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_PASSENGER) { if(GetVehicleModel(GetPlayerVehicleID(playerid) == 570))//Streak Trailer (Train) { if(trainticket[playerid] == 1) { trainticket[playerid] = 0;//takes the player ticket SendClientMessage(playerid,0xFFFF00AA,"Welcome to the Brownstreak (Train) sir!"); } } else { SendClientMessage(playerid,0xFF0000AA,"You can not enter in train sir, you have not a ticket!"); RemovePlayerFromVehicle(playerid); } } return 1; }