16.05.2011, 16:32
The "/job <jobname>" command:
And in stead of doing this in the command
i want to make a chackpoint where this is executed in stead.
pawn Код:
COMMAND:job(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5, 359.1181,206.6940,1008.3828))
{
if(PlayerInfo[playerid][pJob] > 0)
{
SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) You already have a job");
}
else
{
if(PlayerInfo[playerid][pMoney] < 30)
{
SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) You need 30 ServerMoney to get a job");
}
else
{
if(sscanf(params, "s[30]", params[0]))return SendClientMessage(playerid, COLOR_SYSTEMRED, "USAGE: /job <jobname>");
if(!strcmp(params[0], "mechanic", true)) // Job id 1
{
SetPlayerSkin(playerid, 50);
SetPlayerColor(playerid, COLOR_MECHANIC);
SendClientMessage(playerid, COLOR_GREEN, "( $ ) -30 ServerMoney");
PlayerPlaySound(playerid, 1138, 0, 0, 0);
PlayerInfo[playerid][pMoney] -= 30;
PlayerInfo[playerid][pJob] = 1;
SaveUserData(playerid);
}
else if(!strcmp(params[0], "medical worker", true)) // Job id 2
{
// ha
}
else SendClientMessage(playerid, COLOR_SYSTEMRED, "USAGE: /job <jobname>");
}
}
}
else
{
SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) You must be in the Job Centre to get a job");
}
return 1;
}
pawn Код:
SetPlayerSkin(playerid, 50);
SetPlayerColor(playerid, COLOR_MECHANIC);
SendClientMessage(playerid, COLOR_GREEN, "( $ ) -30 ServerMoney");
PlayerPlaySound(playerid, 1138, 0, 0, 0);
PlayerInfo[playerid][pMoney] -= 30;
PlayerInfo[playerid][pJob] = 1;
SaveUserData(playerid);