11.02.2013, 11:48
here is some code :
Maybe someone can help.. It dosn't show message when player is driver!
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == Cars[GroveStreet])
{
if (Group_GetPlayer(gGSF, playerid)) // Can use the car.
{
SendClientMessage(playerid, COLOR_RED, " %s spins a key and tries to start vehicle engine.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You aren't in team Grove Street Crips");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
if(CarCheck == Cars[SevileCrips])
{
if (Group_GetPlayer(gSBF, playerid)) // Can use the car.
{
SendClientMessage(playerid, COLOR_RED, " %s spins a key and tries to start vehicle engine.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You aren't in team Sevile Beach Crips");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
if(CarCheck == Cars[VeronaBeachCrips])
{
if (Group_GetPlayer(gVBF, playerid)) // Can use the car.
{
SendClientMessage(playerid, COLOR_RED, " %s spins a key and tries to start vehicle engine.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You aren't in Verona Beach Crips");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
if(CarCheck == Cars[TempleDriveCrips])
{
if (Group_GetPlayer(gTDF, playerid)) // Can use the car.
{
SendClientMessage(playerid, COLOR_RED, " %s spins a key and tries to start vehicle engine.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You aren't in Temple Drive Crips");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
}
return 1;
}