public OnPlayerCommandText(playerid, cmdtext[])
{
if(strccmd(cmd,"/kick",true)==0){
new aname[MAX_PLAYERS_NAME];
GetPlayerName(playerid,aname,MAX_PLAYERS_NAME);
format(file,sizeof(file),CONTAS,aname);
if{pAdmin[playerid]== 1){
new tmp[256]
strmid{tmp,cmdtext, 2,strlen(cmdtext));
if(lsrlen(tmp))[
SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]);
return 1;
}else[
format(string,sizeof(string, |ADMIN-CMD| O Administrador %s Kikcou o Jogador %!"aname,tmp);
return 1;
SendClientMessage,playerid,azul" |ERRO| Vocк nгo tem Permissгo para Executar este Comando!);
}
return 1;
}
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(95) : error 017: undefined symbol "strccmd"
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(96) : error 017: undefined symbol "MAX_PLAYERS_NAME"
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(96) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(96) : error 036: empty statement
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(96) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd,"/kick",true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
format(file,sizeof(file),CONTAS,aname);
if(pAdmin[playerid]== 1)
{
new tmp[256]
strmid(tmp,cmdtext, 2,strlen(cmdtext));
if(!srlen(tmp))
{
SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]);
return 1;
}
else
{
format(string,sizeof(string), "|ADMIN-CMD| O Administrador %s Kikcou o Jogador %!"aname,tmp);
return 1;
SendClientMessage,playerid,azul," |ERRO| Vocк nгo tem Permissгo para Executar este Comando!");
}
return 1;
}
Tente:
PHP код:
|
if(strcmp(cmd,"/kick",true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
format(file,sizeof(file),CONTAS,aname);
if(pAdmin[playerid] != 1) return false;
new tmp[256]
strmid(tmp,cmdtext, 2,strlen(cmdtext));
if(!srlen(tmp))
return SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]");
format(string,sizeof(string), "|ADMIN-CMD| O Administrador %s Kikcou o Jogador %!",aname,tmp);
SendClientMessageToAll(azul,string);
SendClientMessage(playerid,azul," |ERRO| Vocк nгo tem Permissгo para Executar este Comando!");
return 1;
}
Isso vai dar erro..
pawn Код:
|
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(95) : error 017: undefined symbol "cmd"
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(99) : error 017: undefined symbol "file"
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(99) : error 017: undefined symbol "file"
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(99) : error 029: invalid expression, assumed zero
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(99) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
Eu Deixei do Jeito que ele postou So Corrigi:
" - que faltavam ! - que estavam definidas como l E o MAX_PLAYER_NAME - que tava com o S dps de player '-' |
if(strcmp(cmd,"/kick",true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
format(file,sizeof(file),CONTAS,aname);
if(pAdmin[playerid] != 1) return false;
new tmp[256]
strmid(tmp,cmdtext, 2,strlen(cmdtext));
if(!srlen(tmp))
return SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]");
format(string,sizeof(string), "|ADMIN-CMD| O Administrador %s Kikcou o Jogador %!",aname,tmp);
SendClientMessageToAll(azul,string);
SendClientMessage(playerid,azul," |ERRO| Vocк nгo tem Permissгo para Executar este Comando!");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
cmd = strtok(cmdtext, idx);
// - Comeзo dos Comandos - //
if(strcmp(cmd, "/kick", true) == 0)
{
new aname[MAX_PLAYERS_NAME], file[40];
GetPlayerName(playerid,aname,MAX_PLAYERS_NAME);
format(file,sizeof(file),CONTAS,aname);
if(pAdmin[playerid] != 1) return false;
strmid(tmp,cmdtext, 2,strlen(cmdtext));
if(!srlen(tmp)) return SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]);
format(string,sizeof(string), "|ADMIN-CMD| O Administrador %s Kikcou o Jogador %!" aname,tmp);
SendClientMessage,playerid,azul" |ERRO| Vocк nгo tem Permissгo para Executar este Comando!");
}
return 1;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}