31.07.2012, 03:10
Код:
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; }
EDIT: now i've edited it done and it should be good.