rendered paste bodystock IsPlayerInCar(playerid) {
new count_cars;
for(new i = 0; i <= sizeof(cars_array); i++){
if(cars_array[i] == GetVehicleModel(GetPlayerVehicleID(playerid))){
count_cars++;
}
}
if(count_cars > 0) {
return 1;
}
return 0;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 1) {
TextDrawDestroy(showspeed[playerid]);
}
if(newstate == 2) {
if(IsPlayerInBoat(playerid)) {
SendClientMessage(playerid,COLOR_YELLOW,"Type /fish to go fishing.");
SendClientMessage(playerid,COLOR_YELLOW,"Type /lock to lock the boat doors");
SendClientMessage(playerid,COLOR_YELLOW,"Type /unlock to unlock the boat doors");
}
if(IsPlayerInCar(playerid)) {
SendClientMessage(playerid,COLOR_YELLOW,"Type /lock to lock the car doors");
SendClientMessage(playerid,COLOR_YELLOW,"Type /unlock to unlock the car doors");
}
}
return 1;
}
Array is from http://michaelnets.com/sa-mp/vehicles.php