Strcmp to zcmd help - 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: Strcmp to zcmd help (
/showthread.php?tid=599986)
Strcmp to zcmd help -
Tass007 - 01.02.2016
Need help converting this strcmp to zcmd.
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[64], temp1, temp2;
if (strcmp(cmdtext, "/gatemode", true, 9) == 0)
{
if (strlen(cmdtext[10]) == 0)
{
SendClientMessage(playerid, 0xFFFF00FF, "Usage: /gatemode 0 = commands, 1 = automatic");
return 1;
}
temp1 = strval(cmdtext[10]);
if (temp1 != 0 && temp1 != 1)
{
SendClientMessage(playerid, 0xFFFF00FF, "Usage: /gatemode 0 = commands, 1 = automatic");
return 1;
}
As always, who ever helps will get +1 Rep.
Cheers, thanks for your time.
Re: Strcmp to zcmd help -
KillerDVX - 01.02.2016
PHP код:
CMD:gatemode(playerid, params[ ])
{
if(isnull(params))
{
SendClientMessage(playerid, 0xFFFF00FF, "Usage: /gatemode 0 = commands, 1 = automatic");
return 1;
}
temp1 = strval(params);
if (temp1 != 0 && temp1 != 1)
{
SendClientMessage(playerid, 0xFFFF00FF, "Usage: /gatemode 0 = commands, 1 = automatic");
return 1;
}
Re: Strcmp to zcmd help -
Tass007 - 01.02.2016
Thank you. +1 Rep