Help with checkpoints - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with checkpoints (
/showthread.php?tid=255621)
Help with checkpoints -
sim_sima - 16.05.2011
Well... I know i posted this earlier, but it seems like people didnt understand, so here i will clear up a bit.
I am makeing a job system. It has a command called "/job <jobnaame>".
When a player types ex. "/job mechanic" it will set a checkpoint for the player on the mechanics spawn. When he enteres that checkpoint, his skin and color will change.
I have made the command and everything, the only thing i need help with is the checkpoint.
Thank you.
Re: Help with checkpoints -
boelie - 16.05.2011
show us your code so its easyer to fill in and explain please
Re: Help with checkpoints -
sim_sima - 16.05.2011
Quote:
Originally Posted by boelie
show us your code so its easyer to fill in and explain please
|
The "/job <jobname>" command:
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;
}
And in stead of doing this in the command
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);
i want to make a chackpoint where this is executed in stead.
Re: Help with checkpoints -
Seven_of_Nine - 16.05.2011
'params[0]'? Use 'params' instead. No need to sscanf if you wanna use only 1 parameter.
Re: Help with checkpoints -
sim_sima - 16.05.2011
Quote:
Originally Posted by Seven_of_Nine
'params[0]'? Use 'params' instead. No need to sscanf if you wanna use only 1 parameter.
|
I will add more params later. But its the checkpoint i need help with.
Re: Help with checkpoints -
sim_sima - 16.05.2011
Come on people! You gotta be kidding me! Its a very easy question