Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if((newkeys & KEY_FIRE) && pTazer[playerid] == 1 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(TazerTimeout[playerid] > 0)
- {
- return 1;
- }
- new Float:X, Float:Y, Float:Z;
- foreach(Player, i)
- {
- if(IsPlayerStreamedIn(i, playerid))
- {
- GetPlayerPos(i, X, Y, Z);
- if(IsPlayerAimingAt(playerid,X,Y,Z,1) && PlayerCuffed[i] == 0 && GetPlayerState(i) == PLAYER_STATE_ONFOOT && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
- {
- if(PlayerInfo[i][pAdminDuty] >= 2 && PlayerInfo[i][pTogReports] != 1)
- {
- SendClientMessageEx(playerid, COLOR_GRAD2, "Admins can not be tazed!");
- return 1;
- }
- new string[44 + (MAX_PLAYER_NAME * 2)];
- format(string, sizeof(string), "* %s fires their tazer at %s, stunning them.", GetPlayerNameEx(playerid), GetPlayerNameEx(i));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- GameTextForPlayer(i, "~r~Tazed", 3500, 3);
- SendAudioToRange(10300, 100, 0, X, Y, Z, 20.0);
- TogglePlayerControllable(i, 0);
- ApplyAnimation(i,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
- PlayerPlaySound(i, 1085, X, Y, Z);
- PlayerPlaySound(playerid, 1085, X, Y, Z);
- PlayerCuffed[i] = 1;
- SetPVarInt(i, "PlayerCuffed", 1);
- PlayerCuffedTime[i] = 16;
- SetPVarInt(i, "IsFrozen", 1);
- //Frozen[i] = 1;
- TazerTimeout[playerid] = 4;
- SetTimerEx("TazerTimer",1000,false,"d",playerid);
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~Tazer reloading... ~w~5", 1500,3);
- return 1;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement