09.07.2015, 11:14
(
Последний раз редактировалось Sc0pion; 09.07.2015 в 12:22.
)
Fixed!
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(vehicleid == 437 || vehicleid == 431)
{
if(Bus_Driver[playerid] == 1)
{
SendClientMessage(playerid,COLOR_YELLOW, "Use /busdriver to begin.");
}
}
if(vehicleid != 437 || vehicleid != 431)
{
if(Bus_Driver[playerid] == 0)
{
SendClientMessage(playerid,COLOR_YELLOW, "Bus driver job has been cancelled as you got into another vehicle other than a coach, or a bus.");
}
}
return 1;
}
Player looses the job doesn't matter which vehicle he/she gets in.
PHP код:
You are wrong mate: PHP код:
|
public OnPlayerStateChange(playerid, newstate, oldstate) { new vehicleid = GetVehicleModel(GetPlayerVehicleID(playerid)); /*------------------------------------------------------ -> When player enters a coach or a buss ------------------------------------------------------*/ if(vehicleid == 437 || vehicleid == 431) { if(Bus_Driver[playerid] == 0) { return SendClientMessage(playerid,COLOR_YELLOW, "Use /busdriver to begin.");// This works when I'm not a bus driver. } } if(vehicleid != 437 && vehicleid != 431) { if(Bus_Driver[playerid] == 1) { return SendClientMessage(playerid,COLOR_YELLOW, "Bus driver job has been cancelled as you got into another vehicle other than a coach, or a bus."); } } return 1; }
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetVehicleModel(GetPlayerVehicleID(playerid));
/*------------------------------------------------------
-> When player enters a coach or a buss
------------------------------------------------------*/
if(vehicleid == 437 || vehicleid == 431)
{
if(!Bus_Driver[playerid]) SendClientMessage(playerid, COLOR_YELLOW, "Use /busdriver to begin.");
}
else
{
if(Bus_Driver[playerid] == 1)
{
SendClientMessage(playerid,COLOR_YELLOW, "Bus driver job has been cancelled as you got into another vehicle other than a coach, or a bus.");
//Bus_Driver[playerid] = 0;
}
}
}
return 1;
}
if(vehicleid != 437 || vehicleid != 431)
if(vehicleid != 437 && vehicleid != 431)