Papana Posted April 21, 2012 Posted April 21, 2012 Deci am sistemul de droguri de mats si de bani pentru factiunisi am mai facut la el pentru 2 factiunifactiunea 19 Grove Streetfactiunea 21 San Fierro RifaDar nu imi merg comenzile/fbalance /fwithdraw /fdeposit/fmats /fdrugseu am facut bine peste tot cum trebuia dar tot nu imi mergela comenzile /fmats si /fdrugs zice server unknownca si cum comanda nu ar fi ...Comenzile:::/---------------------------------[F-DEPOSIT-SITEM]------------------------------------- if(strcmp(cmd, "/fdeposit", true) == 0) { if(IsAMember(playerid)) { if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fdeposit [amount]"); format(string, sizeof(string), " You Have $%d in your hq.", PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_GRAD3, string); return 1; } new cashdeposit = strval(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fdeposit [amount]"); format(string, sizeof(string), " You Have $%d in your hq.", PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_GRAD3, string); return 1; } if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much"); return 1; } GivePlayerMoney(playerid,-cashdeposit); new curfunds = PlayerInfo[playerid][pAccf]; PlayerInfo[playerid][pAccf]=cashdeposit+PlayerInfo[playerid][pAccf]; SendClientMessage(playerid, COLOR_WHITE, "|___ SAFE BOX ___|"); format(string, sizeof(string), " Old Balance: $%d", curfunds); SendClientMessage(playerid, COLOR_GRAD2, string); format(string, sizeof(string), " Deposit: $%d",cashdeposit); SendClientMessage(playerid, COLOR_GRAD4, string); SendClientMessage(playerid, COLOR_GRAD6, "|-----------------|"); format(string, sizeof(string), " New Balance: $%d", PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } } return 1; } if(strcmp(cmd, "/fwithdraw", true) == 0) { if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pLeader] == 19 || PlayerInfo[playerid][pLeader] == 21) { if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fwithdraw [amount]"); format(string, sizeof(string), " You Have $%d in your hq.", PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_GRAD3, string); return 1; } new cashdeposit = strval(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fwithdraw [amount]"); format(string, sizeof(string), " You Have $%d in your hq.", PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_GRAD3, string); return 1; } if (cashdeposit > PlayerInfo[playerid][pAccf] || cashdeposit < 1) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much !"); return 1; } //ConsumingMoney[playerid] = 1; GivePlayerMoney(playerid,cashdeposit); PlayerInfo[playerid][pAccf]=PlayerInfo[playerid][pAccf]-cashdeposit; format(string, sizeof(string), " You Have Withdrawn $%d from your hq Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } } return 1; } if(strcmp(cmd, "/fbalance", true) == 0) { if(IsAMember(playerid)) { if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { format(string, sizeof(string), " You Have $%d in your hq.",PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_YELLOW, string); } } return 1; } if(strcmp(cmd, "/fdrugs", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsAMember(playerid)) { new x; x = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader]; /*if(DynamicFactions[x][fSafe] <= 0) { SCM(playerid, COLOR_WHITE, "The leader must buy a SAFE first !"); return 1; }*/ new x_nr[256]; x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { format(string, sizeof(string), "Faction Drugs: $%d.", DynamicFactions[x][fDrugs]); SCM(playerid, COLOR_WHITE, string); } SCM(playerid, COLOR_WHITE, "|______________________FactionsDrugs___________________|"); SCM(playerid, COLOR_WHITE, "| USAGE: /fdrugs [name] [ammount]"); SCM(playerid, COLOR_GREY, " | Available names: Take , Put"); SCM(playerid, COLOR_WHITE, "|______________________________________________________|"); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, playername, sizeof(playername)); if(strcmp(x_nr,"take",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fdrugs take [amount]"); return 1; } new materialsdeposit = strval(tmp); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fdrugs take [amount]"); return 1; } if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { if(materialsdeposit <=DynamicFactions[x][fDrugs]) { PlayerInfo[playerid][pDrugs] += materialsdeposit; DynamicFactions[x][fDrugs]=DynamicFactions[x][fDrugs]-materialsdeposit; format(string, sizeof(string), "You have taken %d drugs from the storage facility, Drugs Total: %d ", materialsdeposit,DynamicFactions[x][fDrugs]); SCM(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has just taken %d drugs from the faction storage facility.",sendername,materialsdeposit); SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string); SaveDynamicFactions(); return 1; } else { SCM(playerid, COLOR_GREY, "There isn't that much drugs in storage!"); } } else { SCM(playerid, COLOR_GREY , "You are not at the faction storage facility!"); } } else if(strcmp(x_nr,"put",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fdrugs put [amount]"); return 1; } new materialsdeposit = strval(tmp); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fdrugs put [amount]"); return 1; } if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { if(materialsdeposit <= PlayerInfo[playerid][pDrugs]) { PlayerInfo[playerid][pDrugs] =PlayerInfo[playerid][pDrugs]-materialsdeposit; DynamicFactions[x][fDrugs] +=materialsdeposit; format(string, sizeof(string), "You putted %d drugs from the storage facility, Drugs Total: %d ", materialsdeposit,DynamicFactions[x][fDrugs]); SCM(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has just putted %d drugs from the faction storage facility.",sendername,materialsdeposit); SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string); SaveDynamicFactions(); return 1; } else { SCM(playerid, COLOR_GREY, "You don't have that much drugs on you!"); } } else { SCM(playerid, COLOR_GREY, "You are not at the faction storage facility!"); } } else { SCM(playerid, COLOR_GREY, "Unknown fDrugs name !"); return 1; } } else { SCM(playerid, COLOR_GREY, "You are not a gang member !"); return 1; } } return 1; } if(strcmp(cmd, "/fmats", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsAMember(playerid)) { new x; x = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader]; if(PlayerInfo[playerid][pRank] < 3) { SCM(playerid, COLOR_GREY, " You need to be Rank 3 or Higher for this action !"); return 1; } /*if(DynamicFactions[x][fSafe] <= 0) { SCM(playerid, COLOR_WHITE, "The leader must buy a SAFE first !"); return 1; }*/ new x_nr[256]; x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ])) { format(string, sizeof(string), "Faction Mats: $%d.", DynamicFactions[x][fMats]); SCM(playerid, COLOR_WHITE, string); } SCM(playerid, COLOR_WHITE, "|________________________fMats_________________________|"); SCM(playerid, COLOR_WHITE, "| USAGE: /fmats [name] [ammount]"); SCM(playerid, COLOR_GREY, " | Available names: Take , Put"); SCM(playerid, COLOR_WHITE, "|______________________________________________________|"); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, playername, sizeof(playername)); if(strcmp(x_nr,"take",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fmats take [amount]"); return 1; } new materialsdeposit = strval(tmp); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fmats take [amount]"); return 1; } if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ])) { if(materialsdeposit <=DynamicFactions[x][fMats]) { PlayerInfo[playerid][pMats] += materialsdeposit; DynamicFactions[x][fMats]=DynamicFactions[x][fMats]-materialsdeposit; format(string, sizeof(string), "You have taken %d mats from the storage facility, Materials Total: %d ", materialsdeposit,DynamicFactions[x][fMats]); SCM(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has just taken %d mats from the faction storage facility.",sendername,materialsdeposit); SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string); SaveDynamicFactions(); return 1; } else { SCM(playerid, COLOR_GREY, "There isn't that much mats in storage!"); } } else { SCM(playerid, COLOR_GREY , "You are not at the faction storage facility!"); } } else if(strcmp(x_nr,"put",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fmats put [amount]"); return 1; } new materialsdeposit = strval(tmp); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fmats put [amount]"); return 1; } if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ])) { if(materialsdeposit <= PlayerInfo[playerid][pMats]) { PlayerInfo[playerid][pMats] =PlayerInfo[playerid][pMats]-materialsdeposit; DynamicFactions[x][fMats] +=materialsdeposit; format(string, sizeof(string), "You putted %d mats from the storage facility, Materials Total: %d ", materialsdeposit,DynamicFactions[x][fMats]); SCM(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has just putted %d mats from the faction storage facility.",sendername,materialsdeposit); SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string); SaveDynamicFactions(); return 1; } else { SCM(playerid, COLOR_GREY, "You don't have that much mats on you!"); } } else { SCM(playerid, COLOR_GREY, "You are not at the faction storage facility!"); } } else { SCM(playerid, COLOR_GREY, "Unknown fMats name !"); return 1; } } else { SCM(playerid, COLOR_GREY, "You are not a gang member !"); return 1; } } return 1; } si cu publicu unde trebuie scris numarul factiuni ca sa mearga comanda pentru acea factiune public IsAMember(playerid) { if(IsPlayerConnected(playerid)) { new leader = PlayerInfo[playerid][pLeader]; new member = PlayerInfo[playerid][pMember]; if(member==5 || member==6 || member==8 || member==12 || member==13 || member==14 || member==15 || member==19 || member==21) { return 1; } if(leader==5 || leader==6 || leader==8 || leader==12 || leader==13 || leader==14 || leader==15 || leader==19 || leader==21) { return 1; } } return 0; }deci am facut tot bine dar dece aore nu merge :-(pentru celelalte factiuni merge ...niste poze
susu Posted April 27, 2012 Posted April 27, 2012 ai pus pozitiite de la i in care scrii /fmats in factions.cfg ?
Question
Papana
Deci am sistemul de droguri de mats si de bani pentru factiuni
si am mai facut la el pentru 2 factiuni
factiunea 19 Grove Street
factiunea 21 San Fierro Rifa
Dar nu imi merg comenzile
/fbalance /fwithdraw /fdeposit
/fmats /fdrugs
eu am facut bine peste tot cum trebuia dar tot nu imi merge
la comenzile /fmats si /fdrugs zice server unknown
ca si cum comanda nu ar fi ...
Comenzile:::
/---------------------------------[F-DEPOSIT-SITEM]------------------------------------- if(strcmp(cmd, "/fdeposit", true) == 0) { if(IsAMember(playerid)) { if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fdeposit [amount]"); format(string, sizeof(string), " You Have $%d in your hq.", PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_GRAD3, string); return 1; } new cashdeposit = strval(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fdeposit [amount]"); format(string, sizeof(string), " You Have $%d in your hq.", PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_GRAD3, string); return 1; } if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much"); return 1; } GivePlayerMoney(playerid,-cashdeposit); new curfunds = PlayerInfo[playerid][pAccf]; PlayerInfo[playerid][pAccf]=cashdeposit+PlayerInfo[playerid][pAccf]; SendClientMessage(playerid, COLOR_WHITE, "|___ SAFE BOX ___|"); format(string, sizeof(string), " Old Balance: $%d", curfunds); SendClientMessage(playerid, COLOR_GRAD2, string); format(string, sizeof(string), " Deposit: $%d",cashdeposit); SendClientMessage(playerid, COLOR_GRAD4, string); SendClientMessage(playerid, COLOR_GRAD6, "|-----------------|"); format(string, sizeof(string), " New Balance: $%d", PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } } return 1; } if(strcmp(cmd, "/fwithdraw", true) == 0) { if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pLeader] == 19 || PlayerInfo[playerid][pLeader] == 21) { if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fwithdraw [amount]"); format(string, sizeof(string), " You Have $%d in your hq.", PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_GRAD3, string); return 1; } new cashdeposit = strval(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fwithdraw [amount]"); format(string, sizeof(string), " You Have $%d in your hq.", PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_GRAD3, string); return 1; } if (cashdeposit > PlayerInfo[playerid][pAccf] || cashdeposit < 1) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much !"); return 1; } //ConsumingMoney[playerid] = 1; GivePlayerMoney(playerid,cashdeposit); PlayerInfo[playerid][pAccf]=PlayerInfo[playerid][pAccf]-cashdeposit; format(string, sizeof(string), " You Have Withdrawn $%d from your hq Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } } return 1; } if(strcmp(cmd, "/fbalance", true) == 0) { if(IsAMember(playerid)) { if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { format(string, sizeof(string), " You Have $%d in your hq.",PlayerInfo[playerid][pAccf]); SendClientMessage(playerid, COLOR_YELLOW, string); } } return 1; } if(strcmp(cmd, "/fdrugs", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsAMember(playerid)) { new x; x = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader]; /*if(DynamicFactions[x][fSafe] <= 0) { SCM(playerid, COLOR_WHITE, "The leader must buy a SAFE first !"); return 1; }*/ new x_nr[256]; x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { format(string, sizeof(string), "Faction Drugs: $%d.", DynamicFactions[x][fDrugs]); SCM(playerid, COLOR_WHITE, string); } SCM(playerid, COLOR_WHITE, "|______________________FactionsDrugs___________________|"); SCM(playerid, COLOR_WHITE, "| USAGE: /fdrugs [name] [ammount]"); SCM(playerid, COLOR_GREY, " | Available names: Take , Put"); SCM(playerid, COLOR_WHITE, "|______________________________________________________|"); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, playername, sizeof(playername)); if(strcmp(x_nr,"take",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fdrugs take [amount]"); return 1; } new materialsdeposit = strval(tmp); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fdrugs take [amount]"); return 1; } if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { if(materialsdeposit <=DynamicFactions[x][fDrugs]) { PlayerInfo[playerid][pDrugs] += materialsdeposit; DynamicFactions[x][fDrugs]=DynamicFactions[x][fDrugs]-materialsdeposit; format(string, sizeof(string), "You have taken %d drugs from the storage facility, Drugs Total: %d ", materialsdeposit,DynamicFactions[x][fDrugs]); SCM(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has just taken %d drugs from the faction storage facility.",sendername,materialsdeposit); SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string); SaveDynamicFactions(); return 1; } else { SCM(playerid, COLOR_GREY, "There isn't that much drugs in storage!"); } } else { SCM(playerid, COLOR_GREY , "You are not at the faction storage facility!"); } } else if(strcmp(x_nr,"put",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fdrugs put [amount]"); return 1; } new materialsdeposit = strval(tmp); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fdrugs put [amount]"); return 1; } if (PlayerToPoint(30.0, playerid,-2159.122802,641.517517,1052.381713) || PlayerToPoint(30.0, playerid,2324.419921,-1145.568359,1050.710083) || PlayerToPoint(30.0, playerid,1277.9442,-837.3730,1085.6328) || PlayerToPoint(30.0, playerid,1710.433715,-1669.379272,20.225049) || PlayerToPoint(30.0, playerid,942.171997,-16.542755,1000.929687) || PlayerToPoint(30.0, playerid,964.106994,-53.205497,1001.124572) || PlayerToPoint(30.0, playerid,2322.2734,-1172.9292,1027.9766)) { if(materialsdeposit <= PlayerInfo[playerid][pDrugs]) { PlayerInfo[playerid][pDrugs] =PlayerInfo[playerid][pDrugs]-materialsdeposit; DynamicFactions[x][fDrugs] +=materialsdeposit; format(string, sizeof(string), "You putted %d drugs from the storage facility, Drugs Total: %d ", materialsdeposit,DynamicFactions[x][fDrugs]); SCM(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has just putted %d drugs from the faction storage facility.",sendername,materialsdeposit); SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string); SaveDynamicFactions(); return 1; } else { SCM(playerid, COLOR_GREY, "You don't have that much drugs on you!"); } } else { SCM(playerid, COLOR_GREY, "You are not at the faction storage facility!"); } } else { SCM(playerid, COLOR_GREY, "Unknown fDrugs name !"); return 1; } } else { SCM(playerid, COLOR_GREY, "You are not a gang member !"); return 1; } } return 1; } if(strcmp(cmd, "/fmats", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsAMember(playerid)) { new x; x = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader]; if(PlayerInfo[playerid][pRank] < 3) { SCM(playerid, COLOR_GREY, " You need to be Rank 3 or Higher for this action !"); return 1; } /*if(DynamicFactions[x][fSafe] <= 0) { SCM(playerid, COLOR_WHITE, "The leader must buy a SAFE first !"); return 1; }*/ new x_nr[256]; x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ])) { format(string, sizeof(string), "Faction Mats: $%d.", DynamicFactions[x][fMats]); SCM(playerid, COLOR_WHITE, string); } SCM(playerid, COLOR_WHITE, "|________________________fMats_________________________|"); SCM(playerid, COLOR_WHITE, "| USAGE: /fmats [name] [ammount]"); SCM(playerid, COLOR_GREY, " | Available names: Take , Put"); SCM(playerid, COLOR_WHITE, "|______________________________________________________|"); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, playername, sizeof(playername)); if(strcmp(x_nr,"take",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fmats take [amount]"); return 1; } new materialsdeposit = strval(tmp); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fmats take [amount]"); return 1; } if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ])) { if(materialsdeposit <=DynamicFactions[x][fMats]) { PlayerInfo[playerid][pMats] += materialsdeposit; DynamicFactions[x][fMats]=DynamicFactions[x][fMats]-materialsdeposit; format(string, sizeof(string), "You have taken %d mats from the storage facility, Materials Total: %d ", materialsdeposit,DynamicFactions[x][fMats]); SCM(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has just taken %d mats from the faction storage facility.",sendername,materialsdeposit); SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string); SaveDynamicFactions(); return 1; } else { SCM(playerid, COLOR_GREY, "There isn't that much mats in storage!"); } } else { SCM(playerid, COLOR_GREY , "You are not at the faction storage facility!"); } } else if(strcmp(x_nr,"put",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fmats put [amount]"); return 1; } new materialsdeposit = strval(tmp); if(!strlen(tmp)) { SCM(playerid, COLOR_GREY, "[USAGE:] /fmats put [amount]"); return 1; } if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ])) { if(materialsdeposit <= PlayerInfo[playerid][pMats]) { PlayerInfo[playerid][pMats] =PlayerInfo[playerid][pMats]-materialsdeposit; DynamicFactions[x][fMats] +=materialsdeposit; format(string, sizeof(string), "You putted %d mats from the storage facility, Materials Total: %d ", materialsdeposit,DynamicFactions[x][fMats]); SCM(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s has just putted %d mats from the faction storage facility.",sendername,materialsdeposit); SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string); SaveDynamicFactions(); return 1; } else { SCM(playerid, COLOR_GREY, "You don't have that much mats on you!"); } } else { SCM(playerid, COLOR_GREY, "You are not at the faction storage facility!"); } } else { SCM(playerid, COLOR_GREY, "Unknown fMats name !"); return 1; } } else { SCM(playerid, COLOR_GREY, "You are not a gang member !"); return 1; } } return 1; }si cu publicu unde trebuie scris numarul factiuni ca sa mearga comanda pentru acea factiunepublic IsAMember(playerid) { if(IsPlayerConnected(playerid)) { new leader = PlayerInfo[playerid][pLeader]; new member = PlayerInfo[playerid][pMember]; if(member==5 || member==6 || member==8 || member==12 || member==13 || member==14 || member==15 || member==19 || member==21) { return 1; } if(leader==5 || leader==6 || leader==8 || leader==12 || leader==13 || leader==14 || leader==15 || leader==19 || leader==21) { return 1; } } return 0; }deci am facut tot bine dar dece aore nu merge :-(
pentru celelalte factiuni merge ...
niste poze
2 answers to this question
Recommended Posts