16.03.2012, 18:55
Hi i have a command which can be used in multiple places, when i use the command in one of these places it runs all 3 of the SendClientMessage function. Anyway cutting to the chase, here is the command (ZCMD).
pawn Код:
CMD:acceptjob(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10,-1547.7715,123.7701,3.5547))
{
if(pJob[playerid] == 0)
{
pJob[playerid] = TRUCKER;
SendClientMessage(playerid, COLOR_WHITE, ".:: You have now joined the job, Trucker ::.");
SendClientMessage(playerid, COLOR_WHITE, ".:: To start work grab a truck and use /startjob ::.");
}
if(pJob[playerid] > 0)
{
SendClientMessage(playerid, COLOR_WHITE, ".:: You must quit your current job using /quitjob ::.");
}
}
if(IsPlayerInRangeOfPoint(playerid, 10,1760.1884,-1895.4938,13.5612))
{
if(pJob[playerid] == 0)
{
pJob[playerid] = TAXI;
SendClientMessage(playerid, COLOR_WHITE, ".:: You have now joined the job, Taxi Drive ::.");
SendClientMessage(playerid, COLOR_WHITE, ".:: To start work grab a taxi and use /startjob ::.");
}
if(pJob[playerid] > 0)
{
SendClientMessage(playerid, COLOR_WHITE, ".:: You must quit your current job using /quitjob ::.");
}
}
if(IsPlayerInRangeOfPoint(playerid, 10,-2033.3699,133.1192,28.8359))
{
if(pJob[playerid] == 0)
{
pJob[playerid] = MECHANIC;
SendClientMessage(playerid, COLOR_WHITE, ".:: You have now joined the job, Mechanic ::.");
SendClientMessage(playerid, COLOR_WHITE, ".:: To start work grab a tow truck and use /startjob ::.");
}
if(pJob[playerid] > 0)
{
SendClientMessage(playerid, COLOR_WHITE, ".:: You must quit your current job using /quitjob ::.");
}
}
if(IsPlayerInRangeOfPoint(playerid, 10,-1721.8835,1356.2217,7.1805))
{
if(pJob[playerid] ==0)
{
pJob[playerid] = PIZZA;
SendClientMessage(playerid, COLOR_WHITE, ".:: You have now joined the job, Pizza ::.");
SendClientMessage(playerid, COLOR_WHITE, ".:: To start work grab a faggio and use /startjob ::.");
}
if(pJob[playerid] > 0)
{
SendClientMessage(playerid, COLOR_WHITE, ".:: You must quit your current job using /quitjob ::.");
}
}
else SendClientMessage(playerid, COLOR_WHITE, ".:: You must be near a job area to start one! :..");
return 1;
}