07.01.2012, 17:46
WHy this not work when i compile script he give me no error when i enter to try them when i go onduty then i get out from car then its not make me Offline as been write in first one help! what to do >?!
pawn Код:
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT && gTeam[playerid] == TEAM_DRIVER)
{
if(Driveronduty[playerid] == 1)
{
new drivername[30];
GetPlayerName(playerid,drivername,30);
format(string, sizeof(string), "Driver %s(%d) is off duty",drivername,playerid);
SendClientMessageToAll(COLOR_FORESTGREEN,string);
Driveronduty[playerid] =0;
}
}
pawn Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && gTeam[playerid] == TEAM_DRIVER) {
new vehicleidd = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleidd) == 420 || GetVehicleModel(vehicleidd) == 431 || GetVehicleModel(vehicleidd) == 438) {
SendClientMessage(playerid,0x00C7FFAA,"You have entered a drivers vehicle. Type /onduty so you can players calls");
SendClientMessage(playerid,0x00C7FFAA,"All taxi drivers have a fixed rate of $10 / Minute. You get a bonus for picking passengers up");
}
}
pawn Код:
if(newstate == PLAYER_STATE_PASSENGER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(gTeam[playerid] != TEAM_DRIVER && GetVehicleModel(vehicleid) == 420 || GetVehicleModel(vehicleid) == 438 || GetVehicleModel(vehicleid) == 431)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInVehicle(i,vehicleid))
{
if(gTeam[i] == TEAM_DRIVER && GetPlayerState(i) == PLAYER_STATE_DRIVER && Driveronduty[i] == 1)
{
SendClientMessage(playerid, 0xA9A9A9AA, "|_Driver On Duty_|");
SendClientMessage(playerid,COLOR_DARKOLIVEGREEN,"This driver is on duty. You will be charged $10 / 1 game minute");
SendClientMessage(i, 0xA9A9A9AA, "|_Passenger Pick Up_|");
SendClientMessage(i,COLOR_DARKOLIVEGREEN,"You have picked up a paying passenger. You receive a Ј2500 bonus");
oscore = GetPlayerScore(playerid);
SetPlayerScore(playerid, oscore +1);
GivePlayerMoney(i,2500);
Taxipass[playerid] =1;
}
}
}
}
}