Olб, estou usando zcmd para fazer meu servidor sу que estб dando erro. Esse erro nгo й no pawno e sim no jogo, quando eu digito o comando aparece SERVER: Unknown command. em qualquer comando!
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(r, 1, cmdtext);
dcmd(sair, 4, cmdtext);
dcmd(profs, 5, cmdtext);
dcmd(entrar, 6, cmdtext);
dcmd(render, 6, cmdtext);
dcmd(seradmin, 8, cmdtext);
dcmd(rdelradar, 9, cmdtext);
dcmd(rcriarradar, 11, cmdtext);
return false;
/*#endif
new string[128];
format(string,128,"[ERRO] O comando %s nгo й vбlido.", cmdtext);
SendClientMessage(playerid, COLOR_RED, string);
return 1;*/
}
dcmd_sair(playerid, params[])
{
#pragma unused params
if(IsPlayerInRangeOfPoint(playerid, 2.0, 503.3359, 1432.3585, 10.1191))
{
if (BVG_Info[playerid][pInt] == 11)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 2695.6880, -1704.6300, 11.8438);
}
}
return true;
}
dcmd_entrar(playerid, params[])
{
#pragma unused params
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2695.6880, -1704.6300, 11.8438))
{
BVG_Info[playerid][pInt] = 11;
SetPlayerInterior(playerid, 11);
SetPlayerPos(playerid, 1503.3359, 1432.3585, 10.1191);
TogglePlayerControllable(playerid,0);
SetTimerEx("TempoEntraSairInt",1000,false,"i",playerid);
}
return true;
}
dcmd_rcriarradar(playerid, params[])
{
if(BVG_Info[playerid][pAdmin] != 10) return SCM(playerid, -1,"{FF0000}Voce nao tem permissao para isso!");
new brz, prc;
if(sscanf(params,"ii",brz, prc)) return SCM(playerid, -1, "{FF0000}[CMD]:{80FF00} /rcriarradar [Velocidade] [Raio]");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i = 1; i < MAX_RADARS; i++)
{
new stringers[20];
format(stringers, sizeof(stringers), "radari/radar_%d.ini", i);
if(!dini_Exists(stringers))
{
RadarInfo[i][raBrzina] = brz;
//RadarInfo[i][raKazna] = kaz;
RadarInfo[i][raPrecnik] = prc;
RadarInfo[i][raPosX] = x;
RadarInfo[i][raPosY] = y;
RadarInfo[i][raPosZ] = z;
fopen(stringers, io_write);
SaveRadar(i);
RadarUkras(i);
SendClientMessage(playerid, -1, "Voce criou o radar!");
EditObject(playerid, RadarInfo[i][raObj]);
edituje[playerid] = i;
i = 998;
}
}
return 1;
}
dcmd_profs(playerid, params[])
{
#pragma unused params
new str[64] = "Transporte\nMafia\nPolicia\nGoverno";
ShowPlayerDialog(playerid, DialogEmpregos, DIALOG_STYLE_LIST, "{FF0000}Empregos", str, "Selecionar", "Cancelar");
return true;
}
dcmd_seradmin(playerid, params[])
{
#pragma unused params
BVG_Info[playerid][pAdmin] = 10;
return 1;
}
dcmd_render(playerid, params[]){
return dcmd_r(playerid, params);
}
dcmd_r(playerid, params[])
{
#pragma unused params
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
return 1;
}
dcmd_rdelradar(playerid, params[])
{
#pragma unused params
if(BVG_Info[playerid][pAdmin] != 10) return SCM(playerid, -1,"{FF0000}Voce nao tem permissao para isso!");
for(new i = 1; i < MAX_RADARS; i++)
{
new stringers[20];
format(stringers, sizeof(stringers), "radari/radar_%d.ini", i);
if(dini_Exists(stringers))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, RadarInfo[i][raPosX],RadarInfo[i][raPosY],RadarInfo[i][raPosZ]))
{
RadarInfo[i][raBrzina] = 0;
RadarInfo[i][raKazna] = 0;
RadarInfo[i][raPrecnik] = 0;
RadarInfo[i][raPosX] = 0;
RadarInfo[i][raPosY] = 0;
RadarInfo[i][raPosZ] = 0;
DestroyObject(RadarInfo[i][raObj]);
fremove(stringers);
}
}
}
SCM(playerid, -1, "Voce destruiu os radares!");
return 1;
}
Zcmd e OnPlayerCommandtext dб conflito, por isso sempre da unknown command.
Entre OnPlayerCommandText e zcmd й melhor o zcmd, й mais rбpido e й um processador de comandos, sу nгo й mais rбpido que o YCMD.