/delivermats help - +rep!
#3

This is basicly becuse you are using return before you have done the command,
"return" means = "Stop this and go back to normal, (or next function, but in this case normal)"
and you are using
if(IsPlayerInRangeOfPoint(playerid, 5.0, 2179.7886,-2263.6206,14.7734)) return SCM(playerid, COLOR_RED, "You delivered the package and recieved 250 materials.");
that does so when the command comes here you'll end the command and get back to normal.
if you take this away and just does it like:

Код:
CMD:delivermats(playerid, params[])
{
    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;
}
Hope I helped a-lot
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: 1 Guest(s)