Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.79 KB | None | 0 0
  1. ocmd:accept(playerid,params[])
  2. {
  3. new string[64],msg[64],msg2[64];
  4. if(sscanf(params,"s[64]",string)) return SendClientMessage(playerid,COLOR_GOLD,"USAGE: /accept [invite,heal]");
  5. if(!strcmp(string,"heal",false))
  6. {
  7. if(GetPVarInt(playerid,"inv_healamount") == 0) return SendClientMessage(playerid,COLOR_RED,"Nobody asked to heal you.");
  8. //if(!IsPlayerInRangeOfPoint(playerid,7,X,Y,Z);
  9. new healamount = GetPVarInt(playerid,"inv_healamount");
  10. SetPlayerHealth(playerid,GetPVarInt(playerid,"inv_healamount"));
  11. GivePlayerMoney(playerid,-MEDIC_MONEY_GAIN_HEAL_AMOUNT);
  12. GivePlayerMoney(GetPVarInt(playerid,"inv_inviterID"),MEDIC_MONEY_GAIN_HEAL_AMOUNT);
  13. format(msg,sizeof(msg),"Medic %s just healed you to %i HP!",PlayerName(GetPVarInt(playerid,"inv_inviterID")),healamount);
  14. format(msg2,sizeof(msg2),"You healed Player %s by %i HP!",PlayerName(playerid),healamount);
  15. SendClientMessage(playerid,COLOR_GREEN,msg);
  16. SendClientMessage(GetPVarInt(playerid,"inv_inviterID"),COLOR_GREEN,msg2);
  17. return 1;
  18. }
  19. if(!strcmp(string,"invite",false))
  20. {
  21. if(GetPVarInt(playerid,"inv_factID") == 0) return SendClientMessage(playerid,COLOR_RED,"You havent been invited to a faction.");
  22. new fID = GetPVarInt(playerid,"inv_factID");
  23. pInfo[playerid][faction] = fID;
  24. pInfo[playerid][rank] = 1;
  25. switch(pInfo[playerid][faction])
  26. {
  27. case 1:
  28. {
  29. pInfo[playerid][skin] = 280;
  30. new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
  31. SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
  32. SpawnPlayer(playerid);
  33. }
  34. case 2:
  35. {
  36. pInfo[playerid][skin] = 165;
  37. new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
  38. SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
  39. SpawnPlayer(playerid);
  40. }
  41. case 3:
  42. {
  43. pInfo[playerid][skin] = 274;
  44. new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
  45. SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
  46. SpawnPlayer(playerid);
  47. }
  48. case 4:
  49. {
  50. pInfo[playerid][skin] = 277;
  51. new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
  52. SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
  53. SpawnPlayer(playerid);
  54. }
  55. case 5:
  56. {
  57. pInfo[playerid][skin] = 106;
  58. new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
  59. SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
  60. SpawnPlayer(playerid);
  61. }
  62. case 6:
  63. {
  64. pInfo[playerid][skin] = 102;
  65. new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
  66. SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
  67. SpawnPlayer(playerid);
  68. }
  69. case 7:
  70. {
  71. pInfo[playerid][skin] = 109;
  72. new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
  73. SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
  74. SpawnPlayer(playerid);
  75. }
  76. case 8:
  77. {
  78. pInfo[playerid][skin] = 116;
  79. new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
  80. SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
  81. SpawnPlayer(playerid);
  82. }
  83. case 9:
  84. {
  85. pInfo[playerid][skin] = 17;
  86. new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
  87. SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
  88. SpawnPlayer(playerid);
  89. }
  90. case 10:
  91. {
  92. pInfo[playerid][skin] = 50;
  93. new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
  94. SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
  95. SpawnPlayer(playerid);
  96. }
  97. }
  98. format(msg,sizeof(msg),"You joined the faction %s !",fInfo[pInfo[playerid][faction]][f_name]);
  99. SendClientMessage(playerid,COLOR_GREEN,msg);
  100. format(msg2,sizeof(msg2),"%s has joined your faction %s",PlayerName(playerid),fInfo[pInfo[playerid][faction]][f_name]);
  101. SendClientMessage(GetPVarInt(playerid,"inv_inviterID"),COLOR_GREEN,msg2);
  102. new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
  103. SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
  104. SpawnPlayer(playerid);
  105. }
  106. return 1;
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement