Advertisement
Guest User

cuff system

a guest
Sep 19th, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. if((newkeys & KEY_FIRE) && pTazer[playerid] == 1 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  2. {
  3. if(TazerTimeout[playerid] > 0)
  4. {
  5. return 1;
  6. }
  7. new Float:X, Float:Y, Float:Z;
  8. foreach(Player, i)
  9. {
  10. if(IsPlayerStreamedIn(i, playerid))
  11. {
  12. GetPlayerPos(i, X, Y, Z);
  13. if(IsPlayerAimingAt(playerid,X,Y,Z,1) && PlayerCuffed[i] == 0 && GetPlayerState(i) == PLAYER_STATE_ONFOOT && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  14. {
  15. if(PlayerInfo[i][pAdminDuty] >= 2 && PlayerInfo[i][pTogReports] != 1)
  16. {
  17. SendClientMessageEx(playerid, COLOR_GRAD2, "Admins can not be tazed!");
  18. return 1;
  19. }
  20. new string[44 + (MAX_PLAYER_NAME * 2)];
  21. format(string, sizeof(string), "* %s fires their tazer at %s, stunning them.", GetPlayerNameEx(playerid), GetPlayerNameEx(i));
  22. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  23. GameTextForPlayer(i, "~r~Tazed", 3500, 3);
  24. SendAudioToRange(10300, 100, 0, X, Y, Z, 20.0);
  25. TogglePlayerControllable(i, 0);
  26. ApplyAnimation(i,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
  27. PlayerPlaySound(i, 1085, X, Y, Z);
  28. PlayerPlaySound(playerid, 1085, X, Y, Z);
  29. PlayerCuffed[i] = 1;
  30. SetPVarInt(i, "PlayerCuffed", 1);
  31. PlayerCuffedTime[i] = 16;
  32. SetPVarInt(i, "IsFrozen", 1);
  33. //Frozen[i] = 1;
  34. TazerTimeout[playerid] = 4;
  35. SetTimerEx("TazerTimer",1000,false,"d",playerid);
  36. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~Tazer reloading... ~w~5", 1500,3);
  37. return 1;
  38. }
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement