20.06.2014, 12:44
I need two things, and that is a vehicle damage system so like; Lets say the vehicle HP goes down to 350, and then it wont turn on intill restored above 350 HP.
Second thing is I need to make it where if you hit your 'Y' key on your keybored it stuns/tazes the nearest players!
Thanks in advanced for whomever helps!
Here's the stun command if you could just throw it somewhere in this;
Second thing is I need to make it where if you hit your 'Y' key on your keybored it stuns/tazes the nearest players!
Thanks in advanced for whomever helps!
Here's the stun command if you could just throw it somewhere in this;
Код:
command(stun, playerid, params[]) { #pragma unused params new string[128], NearestPlayer = GetClosestPlayer(playerid); if(Groups[Player[playerid][Group]][CommandTypes] != 1 && Groups[Player[playerid][Group]][CommandTypes] != 4) { SendClientMessage(playerid, WHITE, "You're not a law enforcement officer!"); } else if(Groups[Player[NearestPlayer][Group]][CommandTypes] == 1 || Groups[Player[NearestPlayer][Group]][CommandTypes] == 4) { SendClientMessage(playerid, WHITE, "Nearest player is a law enforcer!"); } else { if(GetDistanceBetweenPlayers(NearestPlayer, playerid) < 6) { if(Player[NearestPlayer][Tazed] == 0) { if(!IsPlayerInAnyVehicle(NearestPlayer)) { TogglePlayerControllable(NearestPlayer, false); Player[NearestPlayer][Tazed] = 1; format(string, sizeof(string), "* %s has stunned %s, with their taser.", GetName(playerid), GetName(NearestPlayer)); NearByMessage(playerid, PURPLE, string); SendClientMessage(NearestPlayer, WHITE, "You have been tased. The effect will last for 12 seconds."); SetTimerEx("UntazePlayer", 12000, false, "d", NearestPlayer); } else { SendClientMessage(playerid, WHITE, "The suspect is in a vehicle, you can't tase whilst they're in a vehicle."); } } else { SendClientMessage(playerid, WHITE, "That player is already stunned."); } } else { SendClientMessage(playerid, WHITE, "No players in range!"); } } return 1; }