28.07.2017, 07:28
Hi, i have got a script with function to set skins for any Organization, but my problem is there only have max 3 skin for every Org. I wanna add to max 5 or more but thats not working. If someone here can help me to rebuild this script, thanks.
This command for set Skins for any Org (Commands Admin Lv 10 Only)
And this code to select Skins for Org Member
Thank you so much, i really need any help rightnow. So i will say thank you very much for you guys who's helping me .
This command for set Skins for any Org (Commands Admin Lv 10 Only)
Код:
CMD:skinfororg(playerid, params[]) { new orgid, skin1, skin2, skin3, string[256]; if (adlvl[playerid] < 10 && olvl[playerid] < 1) return 0; if (sscanf(params, "dd", orgid, skin1)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /orgskins [orgid] [skin1] [skin2] [skin3]"); sscanf(params, "ddd", orgid, skin1, skin2); sscanf(params, "dddd", orgid, skin1, skin2, skin3); format(string, 10, "org%d", orgid); if (!dini_Exists(AddDirFile(dir_orgfiles, string))) return SendClientMessage2(playerid, COLOR_RED, "Error: Invalid organization id."); if (skin1 < 0 || skin1 > 311 || skin1 == 74 || skin2 < 0 || skin2 > 311 || skin2 == 74 || skin3 < 0 || skin3 > 311 || skin3 == 74 || skin1 == 0 || (skin2 == 0 && skin3 != 0)) return SendClientMessage2(playerid, COLOR_RED, "Error: Invalid skin id."); dini_IntSet(AddDirFile(dir_orgfiles, string), "skin1", skin1); dini_IntSet(AddDirFile(dir_orgfiles, string), "skin2", skin2); dini_IntSet(AddDirFile(dir_orgfiles, string), "skin3", skin3); if (skin2 != 0) { if (skin3 != 0) format(string, sizeof(string), "%s's skins changed to %d, %d and %d.", dini_Get(AddDirFile(dir_orgfiles, string), "name"), skin1, skin2, skin3); else format(string, sizeof(string), "%s's skins changed to %d and %d.", dini_Get(AddDirFile(dir_orgfiles, string), "name"), skin1, skin2); } else format(string, sizeof(string), "%s's skins changed to %d.", dini_Get(AddDirFile(dir_orgfiles, string), "name"), skin1); SendClientMessage2(playerid, COLOR_SILVER, string); return 1; }
Код:
CMD:selectskin(playerid, params[]) { new string[25], tmp[256], playername[MAX_PLAYER_NAME]; new giveplayerid = GetPVarInt(playerid, "playerorg"); GetPlayerName(playerid, playername, sizeof(playername)); if (giveplayerid == 0) return SendClientMessage2(playerid, COLOR_RED, "Error: You aren't in an organization!"); if(dini_Int(AddDirFile(dir_userfiles, playername), "Freeroam") == 1 && dini_Int(AddDirFile(dir_userfiles, playername), "Roleplay") == 0) return SendClientMessage(playerid, COLOR_RED, "Your gameplay state must be roleplay to use that command."); if ((IsALaw(playerid) || orgcata[giveplayerid-1] == 3) && GetPlayerWantedLevel(playerid) != 0) return SendClientMessage2(playerid, COLOR_RED, "You are a wanted player!"); format(string, 10, "org%d", giveplayerid); new moneys1 = dini_Int(AddDirFile(dir_orgfiles, string), "skin1"); if (moneys1 == 0) return SendClientMessage2(playerid, COLOR_SILVER, "Your organization doesn't have any skins yet."); if (GetPVarInt(playerid, "podfskin") != -1) { new temp1 = dini_Int(AddDirFile(dir_orgfiles, string), "skin2"); if (GetPlayerSkin(playerid) == moneys1) { if (temp1 != 0) { SetPlayerSkinEx(playerid, temp1); SetPVarInt(playerid, "podfskin", temp1); } } else if (GetPlayerSkin(playerid) == temp1) { new temp2 = dini_Int(AddDirFile(dir_orgfiles, string), "skin3"); if (temp2 != 0) { SetPlayerSkinEx(playerid, temp2); SetPVarInt(playerid, "podfskin", temp2); } else { SetPlayerSkinEx(playerid, moneys1); SetPVarInt(playerid, "podfskin", moneys1); } } else { SetPlayerSkinEx(playerid, moneys1); SetPVarInt(playerid, "podfskin", moneys1); } } else { SetPlayerSkinEx(playerid, moneys1); SetPVarInt(playerid, "podfskin", moneys1); } format(tmp, 12, "0x%sFF", dini_Get(AddDirFile(dir_orgfiles, string), "color")); SetPlayerColor(playerid, HexToInt(tmp)); if (GetPVarInt(playerid, "playercolor") != -1) SetPVarInt(playerid, "playercolor", -1); SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Switched organization skin."); if (IsALaw(playerid) || orgcata[GetPVarInt(playerid, "playerorg")-1] == 3 ) { if(onduty[playerid] == 0) { SendClientMessage2(playerid, HexToInt(tmp), "You are now ON duty."); onduty[playerid] = 1; } } return 1; }