11.09.2011, 15:54
(
Последний раз редактировалось [LHT]Bally; 18.09.2011 в 15:55.
Причина: i made new thread because i was told i was spamming
)
delete this please because its classed as spam :S by people.
new bool:OnDuty[MAX_PLAYERS], bool:Called[MAX_PLAYERS], fairtime_timer, pAmount[MAX_PLAYERS];
if(strcmp(cmdtext, "/duty", true))
{
if(OnDuty[playerid] == true)
{
SendClientMessage(playerid, COLOR_WHITE, "You are now off duty!");
SendClientMessage(playerid, COLOR_WHITE, "You will no longer receive duty messages");
OnDuty[playerid] = false;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are now on duty!");
SendClientMessage(playerid, COLOR_WHITE, "You will receive a message when a player needs a ride");
OnDuty[playerid] = false;
}
return 1;
}
if(strcmp(cmdtext, "/fare", true))
{
// prevent spamming
if(Called[playerid] == true)
{
return SendClientMessage(playerid, COLOR_WHITE, "Please wait while calling a taxi!");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You have called a taxi, you have to wait 2 minutes to make a new call");
SendClientMessage(playerid, COLOR_WHITE, "[PAYMENT] You have to pay $5 each 10 minutes (game minutes)");
SetTimerEx("CalledTaxi", 1000*60*120, false, "i", playerid);
Called[playerid] = false;
for(new i; i < MAX_PLAYERS; i++)
{
if(OnDuty[i] == true)
{
SendTaxiMessage(playerid, COLOR_WHITE);
}
}
}
return 1;
}
forward CalledTaxi(playerid);
forward FairTime(playerid);
public CalledTaxi(playerid)
{
return Called[playerid] = false;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(Called[playerid] == true)
{
new model = GetVehicleModel(vehicleid);
if(model == 420 || model == 438)
{
fairtime_timer = SetTimerEx("FairTime", 1000*10, true, "i", playerid);
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(Called[playerid] == true)
{
new paid[128];
format(paid, sizeof paid, "[INFO] You have paid the taxi driver %d", pAmount[playerid]);
SendClientMessage(playerid, COLOR_WHITE, paid);
SendClientMessage(playerid, COLOR_WHITE, "[Taxi Driver] Thank you for driving!"); // random message
KillTimer(fairtime_timer);
pAmount[playerid] = 0;
}
return 1;
}
public FairTime(playerid)
{
if(!IsPlayerInAnyVehicle(playerid)) return 0;
new seat = GetPlayerVehicleSeat(playerid), Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(seat == 1 || seat == 2 || seat == 3)
{
GivePlayerMoney(playerid, GetPlayerMoney(playerid)-5);
SendClientMessage(playerid, COLOR_WHITE, "[PAYMENT] You have paid the taxi driver $5");
pAmount[playerid] += 5;
}
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 3, x, y, z))
{
new vehicle = GetPlayerVehicleID(i), model = GetVehicleModel(vehicle);
if(model == 420 || model == 438)
{
GivePlayerMoney(i, GivePlayerMoney(i, GetPlayerMoney(i)+5));
SendClientMessage(i, COLOR_WHITE, "[PAYMENT] You have been paid $5 by the passenger");
}
}
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
pAmount[playerid] = 0;
return 1;
}
stock SendTaxiMessage(playerid, color)
{
new message[126], caller[MAX_PLAYER_NAME];
GetPlayerName(playerid, caller, sizeof(caller));
format(message, sizeof(message), "%s has called a taxi!", caller);
for(new i; i < MAX_PLAYERS; i++)
{
if(OnDuty[i] == true)
{
SendClientMessage(i, color, message);
}
}
return 1;
}
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(153) : warning 217: loose indentation
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(302) : warning 217: loose indentation
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1474) : error 017: undefined symbol "COLOR_WHITE"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1475) : error 017: undefined symbol "COLOR_WHITE"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1480) : error 017: undefined symbol "COLOR_WHITE"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1481) : error 017: undefined symbol "COLOR_WHITE"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1487) : warning 217: loose indentation
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1492) : error 017: undefined symbol "COLOR_WHITE"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1496) : error 017: undefined symbol "COLOR_WHITE"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1497) : error 017: undefined symbol "COLOR_WHITE"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1504) : error 017: undefined symbol "SendTaxiMessage"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1512) : warning 217: loose indentation
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(2580) : warning 203: symbol is never used: "fairtime_timer"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(2580) : warning 203: symbol is never used: "pAmount"