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;
}
You must return a value after each message is sent to tell the command to stop processing. Or else the command won't stop until it has gone through all the if statements. Just return 1; after each cluster of SendClientMessage "functions" as you call it.
|
Thanks...pretty sure it is a function go look at the wiki, in fact ill bring it to you: This function can be used to send a message to a certain player with any chosen color.
Anyway thanks |
Yes, SendClientMessage is a native function, I thought you were using the word function to describe each group of messages. Just return 1; after each if statement and tell me how it pans out for you. Hope I could be of help.
|