10.08.2009, 22:48
What is wrong with the taxi system that is in my GM
If you scroll all the way down to this peice of code:
It doesnt display that when you enter the vehicle "420" which is a taxi.
Heres the pastebin of my GM
http://pastebin.com/m1935e69d
If you scroll all the way down to this peice of code:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && gTeam[playerid] == TEAM_DRIVER) {
new vehicleidd = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleidd) == 420 || GetVehicleModel(vehicleidd) == 487 || GetVehicleModel(vehicleidd) == 431 || GetVehicleModel(vehicleidd) == 409) {
SendClientMessage(playerid,COLOR_RED,"You have entered a drivers vehicle. Type /onduty to go on duty as a taxi driver");
SendClientMessage(playerid,COLOR_RED,"All taxi drivers have a fixed rate of $1 / Minute. You get a bonus for picking passengers up");
}
}
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_PASSENGER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(gTeam[playerid] != TEAM_DRIVER && GetVehicleModel(vehicleid) == 420 || GetVehicleModel(vehicleid) == 487 || GetVehicleModel(vehicleid) == 431 || GetVehicleModel(vehicleid) == 409)
{
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 $1 / 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;
}
}
}
}
}
if(oldstate == PLAYER_STATE_PASSENGER && newstate == PLAYER_STATE_ONFOOT)
{
if(Taxipass[playerid] == 1)
{
Taxipass[playerid] =0;
}
}
return 1;
}
Heres the pastebin of my GM
http://pastebin.com/m1935e69d

