13.11.2009, 01:10
#endif
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new string[128];
new plname[24];
new plveh = GetPlayerVehicleID(playerid);
switch(newstate) {
case PLAYER_STATE_ONFOOT: {
switch(oldstate) {
case PLAYER_STATE_DRIVER: OnPlayerExitVehicle(playerid,255);
case PLAYER_STATE_PASSENGER: OnPlayerExitVehicle(playerid,255);
}
}
}
return 1;
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(plveh == Vehname[0])
{
GetPlayerName(playerid, plname, 24);
if(strcmp(PlayerName, "dlegend", true) == 0)
{
SendPlayerFormattedText(playerid, 0xFFFF00AA,"Welcome to your Car dlegend");
}
else
{
format(string, sizeof(string), "** Alarm bip bip bip **");
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendPlayerFormattedText(playerid, 0xFFFF00AA, "This car is for dlegend only ! ! !");
RemovePlayerFromVehicle(playerid);
}
}
// else if(plveh == Vehname[1])
// {
///////// code here same as above only with a different name in place of yours
// }
return 1;
}
return 1;
#endif

