[Ajuda] ajuda com sscanf/array
#1

Erro ao compilar:
PHP код:
C:\Users\***\DirigindoNoEstilo.pwn(614) : error 033: array must be indexed (variable "Strings")
C:\Users\***\DirigindoNoEstilo.pwn(623) : error 033: array must be indexed (variable "Strings")
C:\Users\***\DirigindoNoEstilo.pwn(632) : error 033: array must be indexed (variable "Strings"
Codigo:
PHP код:
CMD:setplayer(playeridparams[])
{
    if (
PlayerInfo[playerid][pAdmin] > SubDonoAdminLevel)
    {
        new 
idstring[500], valueStrings[500], name[MAX_PLAYER_NAME];
        if (
sscanf(params"rsi"idStringsvalue))
        {
            
SendClientMessage(playerid, -1"Uso: /setplayer [id] [atributo] [valor]");
            
SendClientMessage(playerid, -1"Atributos Validos: dinheiro - score - veiculo");
            return 
1;
        }
        if (
id == INVALID_PLAYER_ID)
            return 
SendClientMessage(playerid, -1"{FF0000}[ERRO] {FFFFFF}Player invalido!");
        if (
Strings == "dinheiro")
        {
            
PlayerInfo[id][pDinheiro] = value;
            
GetPlayerName(playeridnameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "O Admin %s setou %d em sua conta bancaria!"namevalue);
            
SendClientMessage(id, -1string);
            
GetPlayerName(idnameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "Voce setou %d na conta de %s!"valuename);
            
SendClientMessage(playerid, -1string);
        } else if (
Strings == "score")
        {
            
SetPlayerScore(idvalue);
            
GetPlayerName(playeridnameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "O Admin %s setou voce nivel %d!"namevalue);
            
SendClientMessage(id, -1string);
            
GetPlayerName(idnameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "Voce setou %s no nivel %d!"namevalue);
            
SendClientMessage(playerid, -1string);
        } else if (
Strings == "veiculo")
        {
            
PlayerInfo[id][pVehicle] = value;
            
GetPlayerName(playeridnameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "O Admin %s setou para voce o veiculo de ID %d!"namevalue);
            
SendClientMessage(id, -1string);
            
GetPlayerName(idnameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "Voce setou %d como veiculo de %s!"valuename);
            
SendClientMessage(playerid, -1string);
        } else return 
SendClientMessage(playerid, -1"Atributos Validos: dinheiro - score - veiculo");
        
    } else return 
SendClientMessage(playerid, -1"{FF0000}[ERRO] {FFFFFF}Voce nao tem permissao para utilizar esse comando");
    return 
1;

Reply
#2

PHP код:
CMD:setplayer(playeridparams[])
{
    new 
idset[16], valuestring[128];
    if (
PlayerInfo[playerid][pAdmin] < SubDonoAdminLevel)
        return 
SendClientMessage(playerid, -1"{FF0000}[ERRO] {FFFFFF}Voce nao tem permissao para utilizar esse comando");
    if (
sscanf(params"us[16]i"idsetvalue))
    {
        
SendClientMessage(playerid, -1"Uso: /setplayer [id] [atributo] [valor]"); 
        
SendClientMessage(playerid, -1"Atributos Validos: dinheiro - score - veiculo");
        return 
1;
    }
    if (
id == INVALID_PLAYER_ID
        return 
SendClientMessage(playerid, -1"{FF0000}[ERRO] {FFFFFF}Player invalido!"); 
    if (!
strcmp(set"dinheiro"true))
    {
        
PlayerInfo[id][pDinheiro] = value;
        
GetPlayerName(playeridnameMAX_PLAYER_NAME);
        
format(stringsizeof(string), "O Admin %s setou %d em sua conta bancaria!"namevalue);
        
SendClientMessage(id, -1string);
        
GetPlayerName(idnameMAX_PLAYER_NAME);
        
format(stringsizeof(string), "Voce setou %d na conta de %s!"valuename);
        
SendClientMessage(playerid, -1string);
    }
    else if (!
strcmp(set"score"true))
    {
        
// ...
    
}
    return 
1;

Reply
#3

@Edit

Codigo jб postado ^^
Reply
#4

Quote:
Originally Posted by 1sbedx
Посмотреть сообщение
PHP код:
CMD:setplayer(playeridparams[])
{
    new 
idset[16], valuestring[128];
    if (
PlayerInfo[playerid][pAdmin] < SubDonoAdminLevel)
        return 
SendClientMessage(playerid, -1"{FF0000}[ERRO] {FFFFFF}Voce nao tem permissao para utilizar esse comando");
    if (
sscanf(params"us[16]i"idsetvalue))
    {
        
SendClientMessage(playerid, -1"Uso: /setplayer [id] [atributo] [valor]"); 
        
SendClientMessage(playerid, -1"Atributos Validos: dinheiro - score - veiculo");
        return 
1;
    }
    if (
id == INVALID_PLAYER_ID
        return 
SendClientMessage(playerid, -1"{FF0000}[ERRO] {FFFFFF}Player invalido!"); 
    if (!
strcmp(set"dinheiro"true))
    {
        
PlayerInfo[id][pDinheiro] = value;
        
GetPlayerName(playeridnameMAX_PLAYER_NAME);
        
format(stringsizeof(string), "O Admin %s setou %d em sua conta bancaria!"namevalue);
        
SendClientMessage(id, -1string);
        
GetPlayerName(idnameMAX_PLAYER_NAME);
        
format(stringsizeof(string), "Voce setou %d na conta de %s!"valuename);
        
SendClientMessage(playerid, -1string);
    }
    else if (!
strcmp(set"score"true))
    {
        
// ...
    
}
    return 
1;

Obrigado, ajudou muito!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)