09.01.2011, 02:08
Isto deve resolver o seu problema:
Apague todo este cуdigo do seu GM e compile:
Se o comando /ban continuar causando bugs troque-o por:
E adicione no Final do GM:
Espero ter ajudado
Apague todo este cуdigo do seu GM e compile:
pawn Код:
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;
}
Se o comando /ban continuar causando bugs troque-o por:
pawn Код:
if(strcmp("/ban", cmdtext, true, 3) == 0)
{
if ( IsPlayerConnected( playerid) )
{
tmp = KcmD(1, cmdtext);
if ( !strlen( tmp) )
{
SendClientMessage( playerid, COLOR_GRAD2, "Use : /ban [Id / Nome] [razгo]") ;
return 1 ;
}
giveplayerid = strval(tmp);
new result[64];
result = KcmD(2, cmdtext);
if ( PlayerInfo[playerid][pAdmin] >= 1)
{
if ( IsPlayerConnected( giveplayerid) && PlayerInfo[giveplayerid][pAdmin] == 0)
{
if ( giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName( giveplayerid, giveplayer, sizeof( giveplayer) ) ;
GetPlayerName( playerid, sendername, sizeof( sendername) ) ;
if ( !strlen( result) )
{
SendClientMessage( playerid, COLOR_GRAD2, "Use : /ban [Id / Nome] [reason]") ;
return 1 ;
}
new year, month,day ;
getdate( year, month, day) ;
if ( strcmp( result,"1",true) == 0) { result = "Uso de cheat" ; }
format( string, sizeof( string) , "%s foi banido por %s, razгo: %s ( %d-%d-%d) ", giveplayer, sendername, ( result) ,month,day,year) ;
BanLog( string) ;
format( string, sizeof( string) , "%s foi banido por %s, razгo: %s", giveplayer, sendername, ( result) ) ;
SendClientMessageToAll( COLOR_LIGHTRED, string) ;
new cooordstring[256],lstring[256] ;
format( lstring, sizeof( lstring) , "Vocк foi banido pelo Administrador %s\n\nMotivo : %s\n\nCaso ache que foi algum erro visite nosso forum\n FORUM AKI\n",sendername,( result) ) ;
strcat( cooordstring,lstring) ;
ShowPlayerDialog( giveplayerid, 1000, DIALOG_STYLE_MSGBOX, "Banido", cooordstring, "Ok", "Fechar") ;
strmid( BanInfo[giveplayerid][bMotivo], string, 0, strlen( string) , 256) ;
strmid( BanInfo[giveplayerid][bQuemBaniu], giveplayer, 0, strlen( giveplayer) , 256) ;
BanInfo[giveplayerid][bBan] = 1 ;
SBan( giveplayerid) ;
return 1 ;
}
}//not connected
}
else
{
format( string, sizeof( string) , " %d is not an active player.", giveplayerid) ;
SendClientMessage( playerid, COLOR_GRAD1, string) ;
}
}
return 1 ;
}
E adicione no Final do GM:
pawn Код:
stock KcmD(param, cmdtext[])
{
new string[128], pos, var;
format(string, sizeof(string), "%s ", cmdtext);
while((pos = strfind(string, " ", true)) != -1)
{
if(var == param) return string;
var++;
strdel(string, 0, pos + 1);
if(strcmp(string, " ", true, pos) == 0) goto end;
}
end:
string[0] = '\0';
return string;
}
Espero ter ajudado