Advertisement
Guest User

/invite command

a guest
Jun 29th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.81 KB | None | 0 0
  1. if(strcmp(cmd, "/invite", true) == 0)
  2. {
  3.     if(IsPlayerConnected(playerid))
  4.     {
  5.         tmp = strtok(cmdtext, idx);
  6.         if(!strlen(tmp))
  7.         {
  8.             SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /invite [playerid/PartOfName]");
  9.             return 1;
  10.         }
  11.         new para1;
  12.         new ftext[20];
  13.         para1 = ReturnUser(tmp);
  14.         if (PlayerInfo[playerid][pLeader] >= 1)
  15.         {
  16.             if(IsPlayerConnected(para1))
  17.             {
  18.                 if(para1 != INVALID_PLAYER_ID)
  19.                 {
  20.                     if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Police Force"; ChosenSkin[para1] = 71; SetPlayerSkin(para1, 71); }
  21.                     else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "FBI/ATF"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
  22.                     else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "National Guard"; ChosenSkin[para1] = 287; SetPlayerSkin(para1, 287); }
  23.                     else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Firemen/Ambulance"; ChosenSkin[para1] = 70; SetPlayerSkin(para1, 70); }
  24.                     else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 6; gTeam[para1] = 6; ftext = "La Famiglia Sinatra"; ChosenSkin[para1] = 125; SetPlayerSkin(para1, 125); }
  25.                     //else if(PlayerInfo[playerid][pLeader] == 7) { return 1; }
  26.                     else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 12; ftext = "Hitman Agency"; ChosenSkin[para1] = 249; SetPlayerSkin(para1, 249); }
  27.                     else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "InterGlobal Group"; ChosenSkin[para1] = 148; SetPlayerSkin(para1, 148); }
  28.                     else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Taxi Cab Company"; ChosenSkin[para1] = 255; SetPlayerSkin(para1, 255); }
  29.                     else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "School Instructors"; ChosenSkin[para1] = 59; SetPlayerSkin(para1, 59); }
  30.                     else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Yamaguchi"; ChosenSkin[para1] = 169; SetPlayerSkin(para1, 169); }
  31.                     else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 15; gTeam[para1] = 15; ftext = "Chornaya Bratva"; ChosenSkin[para1] = 258; SetPlayerSkin(para1, 258); }
  32.                     else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "La Vice"; ChosenSkin[para1] = 143; SetPlayerSkin(para1, 143); }
  33.                     GetPlayerName(para1, giveplayer, sizeof(giveplayer));
  34.                     PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
  35.                     PlayerInfo[para1][pRank] = 1;
  36.                     printf("AdmCmd: %s has invited %s to join %s.", sendername, giveplayer, ftext);
  37.                     format(string, sizeof(string), "   You have Joined the %s, you were invited by Leader %s", ftext, sendername);
  38.                     SendClientMessage(para1, COLOR_WHITE, string);
  39.                     format(string, sizeof(string), "   You have Invited %s to join the %s.", giveplayer,ftext);
  40.                     SendClientMessage(playerid, COLOR_WHITE, string);
  41.                 }
  42.             }                                     //not connected
  43.         }
  44.         else
  45.         {
  46.             SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command(leaders only)!");
  47.         }
  48.     }
  49.     return 1;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement