Guest User

Untitled

a guest
Dec 26th, 2011
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.64 KB | None | 0 0
  1. CMD:invite(playerid, params[])
  2. {
  3. new sendername[MAX_PLAYER_NAME];
  4. new giveplayer[MAX_PLAYER_NAME];
  5. new string[128];
  6. new idx;
  7.  
  8. if(IsPlayerConnected(playerid))
  9. {
  10. temp = strtok(params, idx);
  11. if(!strlen(temp))
  12. {
  13. SendClientMessage(playerid, COLOR_GRAD2, "{168BFF}INFO: {959561} /invite {959561}[ID/DioImena] {838361}");
  14. return 1;
  15. }
  16. new para1;
  17. new ftext[20];
  18. para1 = ReturnUser(temp);
  19. if (PlayerInfo[playerid][pLeader] >= 1)
  20. {
  21. if(IsPlayerConnected(para1))
  22. {
  23. if(para1 != INVALID_PLAYER_ID)
  24. {
  25.                      if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Police Department"; ChosenSkin[para1] = 280; SetPlayerSkin(para1, 280); }
  26.                        else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "FBI"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
  27.                        else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 3; gTeam[para1] = 3; ftext = "SWAT"; ChosenSkin[para1] = 285; SetPlayerSkin(para1, 285); }
  28.                        else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 4; gTeam[para1] = 4; ftext = "NG Racers"; ChosenSkin[para1] = 70; SetPlayerSkin(para1, 70); }
  29.                        else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "The Italian Mafia"; ChosenSkin[para1] = 125; SetPlayerSkin(para1, 125); }
  30.                        else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 6; gTeam[para1] = 6; ftext = "Triad Mafia"; ChosenSkin[para1] = 123; SetPlayerSkin(para1, 123); }
  31.                        else if(PlayerInfo[playerid][pLeader] == 7) { PlayerInfo[para1][pTeam] = 7; gTeam[para1] = 7; ftext = "Grove Street Family"; ChosenSkin[para1] = 270; SetPlayerSkin(para1, 270); }
  32.                        else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 8; gTeam[para1] = 8; ftext = "Hitman Agencija"; ChosenSkin[para1] = 186; SetPlayerSkin(para1, 186); }
  33.                        else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 9; gTeam[para1] = 9; ftext = "CNN Studio"; ChosenSkin[para1] = 187; SetPlayerSkin(para1, 187); }
  34.                        else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 10; ftext = "Taxi Kompanija"; ChosenSkin[para1] = 255; SetPlayerSkin(para1, 255); }
  35.                        else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 11; gTeam[para1] = 11; ftext = "UnderGround Racers"; ChosenSkin[para1] = 217; SetPlayerSkin(para1, 217); }
  36.                        else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Mara Salvatrucha"; ChosenSkin[para1] = 110; SetPlayerSkin(para1, 110); }
  37.                        else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 13; gTeam[para1] = 13; ftext = "East Side Locos"; ChosenSkin[para1] = 116; SetPlayerSkin(para1, 116); }
  38.                        else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[para1][pTeam] = 14; gTeam[para1] = 14; ftext = "Medic departmet"; ChosenSkin[para1] = 116; SetPlayerSkin(para1, 116); }
  39.                        else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 15; gTeam[para1] = 15; ftext = "Russian Mafia"; ChosenSkin[para1] = 116; SetPlayerSkin(para1, 116); }
  40.                        else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 16; gTeam[para1] = 16; ftext = "Yakuza"; ChosenSkin[para1] = 116; SetPlayerSkin(para1, 116); }
  41. else { return 1; }
  42. GetPlayerName(para1, giveplayer, sizeof(giveplayer));
  43. GetPlayerName(playerid, sendername, sizeof(sendername));
  44. PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
  45. PlayerInfo[para1][pRank] = 1;
  46. printf("%s je pozvao igraca %s da se prikljuci %s.", sendername, giveplayer, ftext);
  47. format(string, sizeof(string), " Prikljucio si se %s, pozvao te lider %s", ftext, sendername);
  48. SendClientMessage(para1, COLOR_LIGHTBLUE, string);
  49. format(string, sizeof(string), " Pozvao si %s da se pridruzi %s.", giveplayer,ftext);
  50. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  51. SetPlayerInterior(para1,0);
  52. new rand = random(sizeof(gInviteSpawns));
  53. SetPlayerPos(para1, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
  54. SetPlayerFacingAngle(para1, gInviteSpawns[rand][3]);
  55. SetPlayerCameraPos(para1,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
  56. SetPlayerCameraLookAt(para1,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
  57. TogglePlayerControllable(para1, 0);
  58. SelectChar[para1] = 255;
  59. SelectCharID[para1] = PlayerInfo[para1][pMember];
  60. SelectCharPlace[para1] = 1;
  61. OdjecaID1[para1] = 1;
  62. PlayerInfo[para1][pModel] = ChosenSkin[para1];
  63. PlayerInfo[para1][pChar] = ChosenSkin[para1];
  64. SendClientMessage(para1, COLOR_LIGHTRED, "* Koristi Lijevi klik misa da biras skin.");
  65. SendClientMessage(para1, COLOR_LIGHTRED, "* Kada odaberes koristi C na tipkovnici.");
  66.  
  67. }
  68. }
  69. }
  70. else
  71. {
  72. SendClientMessage(playerid, COLOR_GRAD1, " Nisi ovlasten(lideri samo)!");
  73. }
  74. }
  75. return 1;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment