13.07.2013, 22:46
Hello as the topic says i need help with this command i can figure out how i can get it to work alright here it is..
and this is what i need help with.. this command is only allowed to be used by a drug dealer but i also want it to work if your in Faction ID ON faction is "3" and name is "REDNECKS" only That faction should be able to use this command is this possible please help me to understand and create it!
somthing like this shud work??
and this is what i need help with.. this command is only allowed to be used by a drug dealer but i also want it to work if your in Faction ID ON faction is "3" and name is "REDNECKS" only That faction should be able to use this command is this possible please help me to understand and create it!
Код:
CMD:buyseeds(playerid, params[]) { new amount; if(PlayerInfo[playerid][pJob] != DRUGDEALER) return SCM(playerid, COLOR_LIGHTRED, "You are not a drug dealer."); if(!PlayerToPoint(3.0, playerid, -392.1880,-1439.1407,26.3389)) return SCM(playerid, COLOR_GREY, "You are not at the drug farm."); if(sscanf(params,"d",amount)) return SyntaxMSG(playerid, "/buyseeds [amount] (Each seed costs $200)"); if(amount < 1) return SCM(playerid, COLOR_GREY, "Invalid amount."); new price = amount * 200; if(GetCash(playerid) < price) return SCMEx(playerid, COLOR_GREY, "[ERROR]: %d seeds price is %d.", amount, price); SCMEx(playerid, COLOR_FADE2, "{C0C0C0}You have successfully bought {FFFFFF}%d {C0C0C0}seeds, you may plant these seeds.", amount); SCM(playerid, COLOR_LIGHTRED, "[ATTENTION]: Planting these seeds in public places will get you banned."); GiveCash(playerid, -price); PlayerInfo[playerid][pSeeds] += amount; return 1; }
Код:
if(faction != REDNECKS) return SCM(playerid, COLOR_LIGHTRED, "Invalid faction.");