double slash command - 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: double slash command (
/showthread.php?tid=663455)
double slash command -
Kevinas100 - 01.02.2019
How do I make a double slash command with ZCMD?
PHP код:
CMD:/(playerid, params[])
{
if(!user.admin[playerid]) return SendClientMessage(playerid, 0xFF0000, "Si komanda tik adminams");
new txt[128];
if(sscanf(params, "s[128]" txt)) SendClientMessage(playerid, 0xFF0000, "* Naudojimas: // [zinute]");
new zin[256],vardas[MAX_PLAYER_NAME];
GetPlayerName(playerid,vardas,MAX_PLAYER_NAME);
format(zin,sizeof(zin),"%s: %s",vardas,txt);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(user.admin[playerid] || user.meras[playerid])
{
SendClientMessage(i,0xFF4500AA,zin);
}
}
}
return 1;
}
I want it to be like this , but this kind of command gives errors when compiling because of the CMD:/
Re: double slash command -
DarkBr - 01.02.2019
It is not possible with zcmd, since it creates a public function with the address / title command.
Re: double slash command -
TokicMajstor - 02.02.2019
You can create it like this
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("//", cmdtext, true, 10) == 0)
{
////command here
return 1;
}
return 0;
}
Re: double slash command -
SymonClash - 02.02.2019
Or you can use OnPlayerText.
@TokicMajstor, he asked with zcmd.