Help with checkpoints
#1

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.
Reply
#2

show us your code so its easyer to fill in and explain please
Reply
#3

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.
Reply
#4

'params[0]'? Use 'params' instead. No need to sscanf if you wanna use only 1 parameter.
Reply
#5

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.
Reply
#6

Come on people! You gotta be kidding me! Its a very easy question
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)