(13974) : error 021: symbol already defined: "strtok" (13989) : error 047: array sizes do not match, or destination array is too small
strtok(const string[], &index)
{
return result;
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;
}
Apague a strtok toda porque ela jб estб definida.
Eae DJ '-' Aqui й o Most :] |
strtok(const string[], &index)
if ( strcmp( cmd, "/ban", true) == 0)
{
if ( IsPlayerConnected( playerid) )
{
tmp = strtok( cmdtext, idx) ;
if ( !strlen( tmp) )
{
SendClientMessage( playerid, COLOR_GRAD2, "Use : /ban [Id / Nome] [razгo]") ;
return 1 ;
}
giveplayerid = ReturnUser( tmp) ;
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) ) ;
new length = strlen( cmdtext) ;
while ( ( idx < length) && ( cmdtext[idx] <= ' ') )
{
idx++ ;
}
new offset = idx ;
new result[64] ;
while ( ( idx < length) && ( ( idx - offset) < ( sizeof( result) - 1) ) )
{
result[idx - offset] = cmdtext[idx] ;
idx++ ;
}
result[idx - offset] = EOS ;
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 ;
}
Nem confunda o cara Se vocк nгo sabe diferenciar strtok de stock nгo vem falar bobagem okay ? (Y) @ Edit RodiauOUI nгo adianta usar @edit por que vc ja falo a merda e a menssagem ta dada @OFF Nem й BPT. Eu que ajudei ele em algumas coisas. E eu que fiz a parada do BanInfo pro DJ Bruninho. |
(58437) : warning 203: symbol is never used: "strtok2"
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;
}
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 ;
}
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;
}