need help converting DCMD to ZCMD
#1

need help to convert Command!! DCMR to ZCMD
Reply
#2

Please post your command.
Reply
#3

i want to change all its a remade gamemode
Reply
#4

Show one example command.
Reply
#5

ok here!
Quote:

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;
}

Reply
#6

Just press Find and replace type dcmd to replace and cmd to type for new.Got it?
Reply
#7

Quote:
Originally Posted by Dziugsas
Посмотреть сообщение
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
Reply
#8

Quote:
Originally Posted by Mionee
Посмотреть сообщение
What about OnPlayerCommandText?

@OP: Read this: http://forum.sa-mp.com/showpost.php?...84&postcount=2
What do you mean?
Reply
#9

Quote:
Originally Posted by Dziugsas
Посмотреть сообщение
What do you mean?
DCMD requires you to define the commands under OnPlayerText, just renaming the commands to CMD: instead of DCMD_ doesn't entirely "convert" the commands to ZCMD.
Reply
#10

Quote:
Originally Posted by Mionee
Посмотреть сообщение
DCMD requires you to define the commands under OnPlayerText, just renaming the commands to CMD: instead of DCMD_ doesn't entirely "convert" the commands to ZCMD.
If he converts it to ZCMD , he would just need to delete all defines OnPlayerText thats all.HE CONVERTS DCMD TO ZCMD and ZCMD doesnt requires defines...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)