Help with checkpoints
#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


Messages In This Thread
Help with checkpoints - by sim_sima - 16.05.2011, 16:23
Re: Help with checkpoints - by boelie - 16.05.2011, 16:28
Re: Help with checkpoints - by sim_sima - 16.05.2011, 16:32
Re: Help with checkpoints - by Seven_of_Nine - 16.05.2011, 16:36
Re: Help with checkpoints - by sim_sima - 16.05.2011, 16:44
Re: Help with checkpoints - by sim_sima - 16.05.2011, 17:29

Forum Jump:


Users browsing this thread: 2 Guest(s)