05.07.2014, 15:49
need help to convert Command!! DCMR to ZCMD
dcmd_taze(playerid, params[]) { new taze = strval(params); if(!strlen(params)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /taze [ID]"); } else { if(gTeam[playerid] == COP || gTeam[playerid] == SWAT || gTeam[playerid] == ARMY || gTeam[playerid] == FBI) { 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], Floathlth; 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!"); } } else { SendClientMessage(playerid, COLOR_MSG, "You are not Police Officer!"); } } return 1; } |
Just press Find and replace type dcmd to replace and cmd to type for new.Got it?
|
What about OnPlayerCommandText?
@OP: Read this: http://forum.sa-mp.com/showpost.php?...84&postcount=2 |