13.10.2011, 07:03
Код:
new cmd[256]; new idx; cmd = strtok(cmdtext, idx); if (streq(cmd,"/setleader1")) { if(!strlen(cmdtext[12])) { SendClientMessage(playerid, red, "Usage: /setleader1 [playerid]"); return 1; } new ID = strval(cmdtext[12]); new pName[24], str[64]; if(IsPlayerConnected(ID)) { GetPlayerName(playerid, pName, 24); format(str, 123, "Admin %s has set your the leader of organization Rudyy's Gang.", pName); SendClientMessage(ID,COLOR_LIGHTBLUE, str); SetPlayerColor(ID, 0x00C300FF); // Color GivePlayerWeapon(ID,28,5000); // Weapon1 GivePlayerWeapon(ID,1,-1); // Weapon 2 IsInOrg[ID] = 1; // This tells that the user is already in an organization. Member[ID] = 1; //This is org id, forexample my org id i want is 1 , so i will put 1, if i want it 2 , i will put 2. Note; do not duplicate the number. Leader[ID] = 1; //This will remain as "1". This shows that the player ur setting is a leader. IsLaw[ID] = 0; // This shows that the org is not a law enforcement, its a Gang. format(str, 123, "You have set a player leader of Rudyy's Gang."); SendClientMessage(playerid,red, str); } return 1; } if(Leader[playerid] == 1) { if (streq(cmd,"/setmember")) { if(!strlen(cmdtext[11])) { SendClientMessage(playerid, red, "Usage: /setmember [playerid]"); return 1; } new ID = strval(cmdtext[11]); new pName[24], str[64]; if(IsPlayerConnected(ID)) { GetPlayerName(playerid, pName, 24); if(IsInOrg[ID] == 1) return SendClientMessage(playerid,red,"Ths user is already in an organization!"); else if(Member[playerid] == 1 && Member[ID] == 0) { format(str, 123, "Your application to join Rudy's Gang has been accepted by leader %s.", pName); SendClientMessage(ID,COLOR_LIGHTBLUE,str); SetPlayerColor(ID,0x0000BBAA); //color SendClientMessage(ID,green, str); GivePlayerWeapon(ID,24,250); //weapon1 GivePlayerWeapon(ID,3,99999); //weapon2 GivePlayerWeapon(ID,29,1000); //weapon3 (optional) IsInOrg[ID] = 1; //Shows that the user that leader is recruiting is is in org. IsLaw[ID] = 0; //Not a law, gang. Member[ID] = 1; // Org ID format(str, 123, "You have accepted the following member into your organization."); SendClientMessage(playerid,COLOR_LIGHTBLUE, str); } return 1; } } } else if (streq(cmd,"/kickmember")) { if(!strlen(cmdtext[11])) { SendClientMessage(playerid, red, "Usage: /kickmember [playerid]"); return 1; } new ID = strval(cmdtext[11]); new pName[24], str[64]; if(IsPlayerConnected(ID)) { GetPlayerName(playerid, pName, 24); if(Member[playerid] == 1 && Member[ID] == 1) { format(str, 123, "Leader %s has kicked you from organization Rudy's gang.", pName); SendClientMessage(ID,COLOR_ORANGE, str); SetPlayerSkin(ID, 299); ResetPlayerWeapons(ID); Member[ID] = 0; IsLaw[playerid] = 0; IsInOrg[ID] = 0; SetPlayerColor(ID, 0xFFFFFFFF); format(str, 123, "You have kicked a player from Rudy's gang."); SendClientMessage(playerid,red, str); } return 1; } }