/delivermats help - +rep!
#5

Where you want this to be you add
if(PlayerInfo[playerid][pJob] != 1) return SendCleientMessage(playerid, COLOR_WHITE, "[CHANGE THIS ]You don't have the job and can't take the mats");// != means "Is not equal to" while == means is equal to, so i check if the job not is equal to 1 then you should retrun (stop the command and SendClientMesage to the player with the text you want. Change the text to whatever you want it to be

Add this everywhere where you want to check if the player got the job(if they don't got it this is going to stop the command and send a message to the palyer)

example:

Код:
CMD:delivermats(playerid, params[])
{
   if(PlayerInfo[playerid][pJob] != 1) return SendCleientMessage(playerid, COLOR_WHITE, "[CHANGE THIS :)]You don't have the job and can't take the mats");//you can add it later to but the earlier you check it the less other thing the script have to do before detecting this
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2179.7886,-2263.6206,14.7734)){
        if(PlayerInfo[playerid][pGotMaterials] == 0) return SendClientMessage(playerid, COLOR_GREY, "You do not have the packages.");
        PlayerInfo[playerid][pMaterials] += 250;
        PlayerInfo[playerid][pGotMaterials] = 0;
        SCM(playerid, COLOR_RED, "You delivered the package and recieved 250 materials.");
        return 1;//instead you can return here if you want the command to stop here becuse it have done everything it's desired to (notice this will only get called if the player have the materials)
    }//and here you use else(you don't have to but it looks nicer :) )
    else{
    SendClientMessage(playerid, COLOR_WHITE, "You aren't in-range of the material's drop-off!");
    }
    return 1;
}
Reply


Messages In This Thread
/delivermats help - +rep! - by RLGaming - 31.07.2012, 00:50
Re: /delivermats help - +rep! - by RLGaming - 31.07.2012, 02:23
Re: /delivermats help - +rep! - by Ranama - 31.07.2012, 02:30
Re: /delivermats help - +rep! - by RLGaming - 31.07.2012, 02:42
Re: /delivermats help - +rep! - by Ranama - 31.07.2012, 02:53
Re: /delivermats help - +rep! - by RLGaming - 31.07.2012, 02:58
Re: /delivermats help - +rep! - by RLGaming - 31.07.2012, 03:00
Re: /delivermats help - +rep! - by Akira297 - 31.07.2012, 03:01
Re: /delivermats help - +rep! - by Ranama - 31.07.2012, 03:10
Re: /delivermats help - +rep! - by [MM]RoXoR[FS] - 31.07.2012, 03:36

Forum Jump:


Users browsing this thread: 2 Guest(s)