02.10.2012, 21:22
Hello Guyz Can Anyone Help me Pls With My Problem I Want To Make It This Command Only For Police/Cops,FBI,Army
Command:
Pls Anyone Can Help Me? Thank You I Will Rep You!
Command:
Код:
dcmd_taze(playerid, params[]) { new taze = strval(params); if(!strlen(params)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /taze [ID]"); } else { if(IsPlayerConnected(taze)) { if(GetDistanceBetweenPlayers(playerid, taze) <= 6) { if(tazetime[playerid] == 0) { new tehtaze = random(5); if(tehtaze == 1 || tehtaze == 2 || tehtaze == 3 || tehtaze == 4) { new string[256], Float:thlth; format(string, sizeof(string), "%s (%i) has tazed you.",ReturnPlayerName(playerid), playerid); SendClientMessage(taze, COLOR_MSG, string); format(string, sizeof(string), "You have tazed %s (%i).",ReturnPlayerName(taze), taze); SendClientMessage(playerid, COLOR_MSG, string); GetPlayerHealth(taze, thlth); new Float:tehtaze3 = thlth-15-random(30); SetPlayerHealth(taze, tehtaze3); if(thlth < tehtaze3) { format(string, sizeof(string), "%s (%i) has been tazed to death", ReturnPlayerName(taze), taze); SendClientMessageToAll(COLOR_KILLED, string); } else { SendClientMessage(taze, COLOR_MSG, "You are stunned for a while."); TogglePlayerControllable(taze, 0); stunned[taze] = 1; tazetime[playerid] = 1; SetTimerEx("tazetimer", ANTISPAM*1000, 0, "i", playerid); SetTimerEx("stuntimer", STUNNED_TIME*1000, 0, "i", taze); } } else { new string[256], Float:phlth; format(string, sizeof(string), "%s (%i) has accidentally held the tazer the wrong way and tazed himself",ReturnPlayerName(playerid), playerid); SendClientMessage(taze, COLOR_MSG, string); SendClientMessage(playerid, COLOR_MSG, "You accidentally held the tazer the wrong way and tazed yourself"); GetPlayerHealth(playerid, phlth); new Float:tehtaze2 = phlth-25-random(30); SetPlayerHealth(playerid, tehtaze2); if(phlth < tehtaze2) { format(string, sizeof(string), "%s (%i) has been tazed to death",ReturnPlayerName(playerid), playerid); SendClientMessageToAll(COLOR_KILLED, string); } else { SendClientMessage(playerid, COLOR_MSG, "You are stunned for a while."); TogglePlayerControllable(playerid, 0); stunned[playerid] = 1; SetTimerEx("stuntimer", STUNNED_TIME*1000, 0, "i", playerid); SetTimerEx("tazetimer", ANTISPAM*1000, 0, "i", playerid); tazetime[playerid] = 1; } } } else { SendClientMessage(playerid, COLOR_MSG, "Please wait before tazing someone again!"); } } else { new string[256]; format(string, sizeof(string), "%s (%i) is not close enough to taze!", ReturnPlayerName(taze), taze); } } else { SendClientMessage(playerid, COLOR_MSG, "That player is not connected!"); } } return 1; }