31.07.2012, 02:30
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:
Hope I helped a-lot
"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; }