1.Pentru comenzi obisnuite(OnPlayerCommandText)
Mergeti la functia OnPlayerCommandText si coborati pana unde este return 0; si adaugati,inainte de return 0, asta:
ex:
2.Pentru ZCMD
Cautati in mod functia OnPlayerCommandPerformed. DACA o gasiti,adaugati asta:
Daca nu o gasiti,inafara oricarei functii(de preferat...dupa OnPlayerSpawn-e o functie care o gasesti in mai toate modurile)pui asta:
Mergeti la functia OnPlayerCommandText si coborati pana unde este return 0; si adaugati,inainte de return 0, asta:
- Cod:
else
{
new Str[256];
format(Str,256,"EROARE:Comanda {204096}%s{962020} nu exista!Incercati /help si /cmds",cmdtext);
SendClientMessage(playerid,0x962020,Str);
return 1;
}
ex:
- Cod:
public OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmdtext,"/test")==0)
{
SendClientMessage(playerid,~0,"-");
return 1;
}
//si alte sute de comenzi.
else
{
new Str[256];
format(Str,256,"EROARE:Comanda {204096}%s{962020} nu exista!Incercati /help si /cmds",cmdtext);
SendClientMessage(playerid,0x962020,Str);
return 1;
}
}
2.Pentru ZCMD
Cautati in mod functia OnPlayerCommandPerformed. DACA o gasiti,adaugati asta:
- Cod:
if(!success)
{
new Str[256];
format(Str,256,"EROARE:Comanda {204096}%s{962020} nu exista!Incercati /help si /cmds",cmdtext);
SendClientMessage(playerid,0x962020,Str);
return 1;
}
Daca nu o gasiti,inafara oricarei functii(de preferat...dupa OnPlayerSpawn-e o functie care o gasesti in mai toate modurile)pui asta:
- Cod:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
new Str[256];
format(Str,256,"EROARE:Comanda {204096}%s{962020} nu exista!Incercati /help si /cmds",cmdtext);
SendClientMessage(playerid,0x962020,Str);
}
return 1;
}