convert to 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 to zcmd (
/showthread.php?tid=410120)
convert to zcmd -
Markus1337 - 24.01.2013
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(IsPlayerAdmin(playerid))
{
if(!strcmp("/gotomb", cmdtext, true))
{
SetPlayerPos(playerid, MoneyBagPos[0], MoneyBagPos[1] +3, MoneyBagPos[2]);
return SendClientMessage(playerid, -1, "You have been {FF0000}teleported {FFFFFF}to the {33FF66}money bag");
}
if(!strcmp("/startmb", cmdtext, true)) return MoneyBag();
if(!strcmp("/togglemb", cmdtext, true))
{
if(Timer[0] == 0)
{
KillTimer(Timer[1]);
Timer[0] = 1;
SendClientMessage(playerid, -1, "Money bag turned {FF0000} off!");
return 1;
}
if(Timer[0] == 1)
{
Timer[1] = SetTimer("MoneyBag", MB_DELAY, true);
Timer[0] = 0;
SendClientMessage(playerid, -1, "Money bag turned {33FF66} on!");
return 1;
}
return 1;
}
}
if(!strcmp("/moneybag", cmdtext, true))
{
new string[150];
if(!MoneyBagFound) format(string, sizeof(string), "**The {33FF66}Money Bag has been {FF0000}hidden in {FFFF66}%s!", MoneyBagLocation);
if(MoneyBagFound) format(string, sizeof(string), "**The {33FF66}Money Bag is {FF0000} not running!");
return SendClientMessage(playerid, -1, string);
}
return 0;
}
I kinda know how to convert them but this one's tricky :S
AW: convert to zcmd -
Blackazur - 24.01.2013
Код:
COMMAND:gotomb(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
SetPlayerPos(playerid, MoneyBagPos[0], MoneyBagPos[1] +3, MoneyBagPos[2]);
return SendClientMessage(playerid, -1, "You have been {FF0000}teleported {FFFFFF}to the {33FF66}money bag");
return 1;
}
COMMAND:startmb(playerid,params[])
{
return MoneyBag();
return 1;
}
COMMAND:togglemb(playerid,params[])
{
if(Timer[0] == 0)
{
KillTimer(Timer[1]);
Timer[0] = 1;
SendClientMessage(playerid, -1, "Money bag turned {FF0000} off!");
return 1;
}
if(Timer[0] == 1)
{
Timer[1] = SetTimer("MoneyBag", MB_DELAY, true);
Timer[0] = 0;
SendClientMessage(playerid, -1, "Money bag turned {33FF66} on!");
return 1;
}
return 1;
COMMAND:moneybag(playerid,params[])
{
new string[150];
if(!MoneyBagFound) format(string, sizeof(string), "**The {33FF66}Money Bag has been {FF0000}hidden in {FFFF66}%s!", MoneyBagLocation);
if(MoneyBagFound) format(string, sizeof(string), "**The {33FF66}Money Bag is {FF0000} not running!");
return SendClientMessage(playerid, -1, string);
return 1;
}
Re: convert to zcmd -
antonio112 - 24.01.2013
pawn Код:
CMD:gotomb(playerid, params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid))
return 1;
SetPlayerPos(playerid, MoneyBagPos[0], MoneyBagPos[1] +3, MoneyBagPos[2]);
return SendClientMessage(playerid, -1, "You have been {FF0000}teleported {FFFFFF}to the {33FF66}money bag");
}
CMD:gotomb(playerid, params[])
return MoneyBag();
CMD:togglemb(playerid, params[])
{
#pragma unused params
if(Timer[0] == 0)
{
KillTimer(Timer[1]);
Timer[0] = 1;
SendClientMessage(playerid, -1, "Money bag turned {FF0000} off!");
}
else
{
Timer[1] = SetTimer("MoneyBag", MB_DELAY, true);
Timer[0] = 0;
SendClientMessage(playerid, -1, "Money bag turned {33FF66} on!");
}
return 1;
}
CMD:moneybag(playerid, params[])
{
#pragma unused params
new string[150];
if(!MoneyBagFound) format(string, sizeof(string), "**The {33FF66}Money Bag has been {FF0000}hidden in {FFFF66}%s!", MoneyBagLocation);
if(MoneyBagFound) format(string, sizeof(string), "**The {33FF66}Money Bag is {FF0000} not running!");
return SendClientMessage(playerid, -1, string);
}
I gave you in the first command, an example of how you should check if a player is ADMIN. Do the same to the rest and it should work.