Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:safe(playerid, params[])
- {
- if(IsPlayerConnected(playerid))
- {
- 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][pMember] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pMember] == 15)
- {
- new x = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader];
- new string[128];
- if(sscanf(params,"s[128]",params))
- {
- if(PlayerToPoint(2.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
- {
- format(string, sizeof(string), "Faction materials: "WHITE"%d", DynamicFactions[x][fMats]);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }
- SendClientMessage(playerid, -1, ""BLU"USAGE:"WHITE" /safe [withdraw, deposit] [amount]");
- return 1;
- }
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(strcmp(params, "withdraw"))
- {
- new materialswithdraw = strval(tmp);
- if(sscanf(params, "i", materialswithdraw))
- {
- SendClientMessage(playerid, -1, ""BLU"USAGE:"WHITE" /safe withdraw [amount]");
- return 1;
- }
- if(PlayerToPoint(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
- {
- if(materialswithdraw <= DynamicFactions[x][fMats])
- {
- PlayerInfo[playerid][pMats] += materialswithdraw;
- DynamicFactions[x][fMats] = DynamicFactions[x][fMats] - materialswithdraw;
- format(string, sizeof(string), "{CCFF33}* %s has withdrew %d materials from %s Seif. Total Drugs: %d", sendername, materialswithdraw, DynamicFactions[x][fName], DynamicFactions[x][fMats]);
- SendFamilyMessage(x, -1, string);
- SaveDynamicFactions();
- return 1;
- } else return SendClientMessage(playerid, COLOR_GREY, "There isn't that much mats in storage.");
- } else return SendClientMessage(playerid, COLOR_GREY, "You are not at the faction storage facility.");
- }
- else if(strcmp(params, "deposit"))
- {
- new materialsdeposit = strval(tmp);
- if(PlayerToPoint(2.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
- {
- format(string, sizeof(string), "Faction materials: "WHITE"%d", DynamicFactions[x][fMats]);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }
- if(sscanf(params, "i", materialsdeposit))
- {
- if(PlayerToPoint(2.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
- {
- format(string, sizeof(string), "Faction materials: "WHITE"%d", DynamicFactions[x][fMats]);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }
- SendClientMessage(playerid, -1, ""BLU"USAGE:"WHITE" /safe deposit [amount]");
- return 1;
- }
- if(PlayerToPoint(2.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), "{CCFF33}* %s has deposit %d materials in %s Seif. Total Drugs: %d", sendername, materialsdeposit, DynamicFactions[x][fName], DynamicFactions[x][fMats]);
- SendFamilyMessage(x, -1, string);
- SaveDynamicFactions();
- return 1;
- } else return SendClientMessage(playerid, COLOR_GREY, "You don't have that much mats on you.");
- } else return SendClientMessage(playerid, COLOR_GREY, "You are not at the faction storage facility.");
- } else return SendClientMessage(playerid, -1, ""BLU"USAGE:"WHITE" /safe [withdraw, deposit] [amount]");
- } else return SendClientMessage(playerid, COLOR_GREY, "You are not a gang member.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment