How do i make a command like this:
[/command 1] in zcmd if i make it separate i get errors Errors: [/command 1] No Errors: [/command1] How do i make it seperate? |
CMD:gotobusiness(playerid, params[]) { new idx; if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotobiz [bizid]"); //your action here return 1; }
Hello, You cant do it like this, but i think you are trying to make something like this:
Код:
CMD:gotobusiness(playerid, params[]) { new idx; if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotobiz [bizid]"); //your action here return 1; } |
You wrong!
I am asking how do i make a command like CMD:command 1(playerid, params[]) { SendClientMessage(playerid, COLOR_WHITE, "Server Commands"); return 1; } When i do compile it i get errors cause i cant make CMD:command 1 Seperate the 1 so it should be CMD:command1 |
CMD:command(playerid, params[])
{
new idx;
if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /comand number");
switch(idx)
{
case 1:
{
//Have wrote /command 1
}
//ect....
}
return 1;
}
#include <sscanf2>
CMD:command(playerid, params[])
{
if(IsNumeric(params) && strval(params) == 1)
{
// Code here
return 1;
}
return 0;
}
stock IsNumeric(const string[])
{
return !sscanf(string, "{d}");
}