SA-MP Forums Archive
convert dcmd a zcmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: convert dcmd a zcmd (/showthread.php?tid=663785)



convert dcmd a zcmd - nbx2000 - 11.02.2019

Help me convert this command to zcmd and sort it ,,
Is this the good command?



dcmd_winner(playerid,params[])
{
if(event == 1)
{
if(IsPlayerAdmin(playerid))
{
new price, winner;
if(sscanf(params,"ui",winner,price)) return SendClientMessage(playerid,COLOR_RED,"Usage: /winner [ID] [Price]");
new str[128];
format(str,128,"{40E0D0}%s (%i) has won the event, and gained %d",PlayerName(winner),winner,price);
SendClientMessageToAll(-1,str);
GivePlayerMoney(winner,price);
return 1;
}
else{SendClientMessage(playerid,COLOR_RED,"You can't use this command!"); return 1;}
}
else{SendClientMessage(playerid,COLOR_RED,"There is no event running."); return 1;}
}


Re: convert dcmd a zcmd - Kane - 11.02.2019

Replace "dcmd_" with "CMD:"


Re: convert dcmd a zcmd - nbx2000 - 11.02.2019

ready Do you see it right to the command?
CMD:winner(playerid,params[])
{
if(event == 1)
{
if(IsPlayerAdmin(playerid))
{
new price, winner;
if(sscanf(params,"ui",winner,price)) return SendClientMessage(playerid,COLOR_RED,"Usage: /winner [ID] [Price]");
new str[128];
format(str,128,"{40E0D0}%s (%i) has won the event, and gained %d",PlayerName(winner),winner,price);
SendClientMessageToAll(-1,str);
GivePlayerMoney(winner,price);
return 1;
}
else{SendClientMessage(playerid,COLOR_RED,"You can't use this command!");return 1;}
}
else{SendClientMessage(playerid,COLOR_RED,"There is no event running."); return 1;}
}


Re: convert dcmd a zcmd - Kane - 11.02.2019

That's right, yes


Re: convert dcmd a zcmd - nbx2000 - 11.02.2019

and so it is correct to order it to the cmd
CMD:frist(playerid,params[])
{
new price, winner;
if(PlayerInfo[playerid][Level] < 6) return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
if(joinable == 0 && event == 0) return SendClientMessage(playerid, red, "ERROR: No Hay Ningun Evento Para Finalizar!.");
if(sscanf(params,"ui",winner,price)) return SendClientMessage(playerid,COLOR_RED,"Usage: /winner [ID] [Price]");
new str[128];
format(str,128,"%s (%i) has won the event, and gained %d",GetName(winner),winner,price);
GameTextForAll(str,10000,3);
GivePlayerScore(winner,price);
return 1;
}


Re: convert dcmd a zcmd - TheToretto - 11.02.2019

CTRL + H and replace all the "dcmd_" by "CMD:"