[ajuda] Respawn
#1

pawn Код:
if(strcmp(cmd, "/rc", true) == 0)
    {
        if(IsPlayerAdmin(playerid));
        {
            for(new i = 0; i <= MAX_PLAYERS; i++)
            {
                if(IsPlayerInAnyVehicle(i))
                    new nome[MAX_PLAYER_NAME]; //aki
                    GetPlayerName(playerid, nome, MAX_PLAYER_NAME);
                    new msg[80];
                    format(msg, sizeof(msg), "O Admin %s Respawnou os veiculos", nome);
                    SendClientMessageToAll(-1, msg);
                    for(new v = 0; v <= MAX_VEHICLES; v++)
                    {
                        SetVehicleToRespawn(v);
                    }
            }
        }
        return 1;
    }
o que tem de errado com meu cуdigo? da error na linha do new nome

pawn Код:
E:\Documents and Settings\Usuбrio\Desktop\GTA SAMP\BDP2\BDP\filterscripts\V-Admin.pwn(1902) : error 036: empty statement
E:\Documents and Settings\Usuбrio\Desktop\GTA SAMP\BDP2\BDP\filterscripts\V-Admin.pwn(1907) : error 003: declaration of a local variable must appear in a compound block
E:\Documents and Settings\Usuбrio\Desktop\GTA SAMP\BDP2\BDP\filterscripts\V-Admin.pwn(1907) : warning 217: loose indentation
E:\Documents and Settings\Usuбrio\Desktop\GTA SAMP\BDP2\BDP\filterscripts\V-Admin.pwn(1907) : error 017: undefined symbol "nome"
E:\Documents and Settings\Usuбrio\Desktop\GTA SAMP\BDP2\BDP\filterscripts\V-Admin.pwn(1907) : warning 215: expression has no effect
E:\Documents and Settings\Usuбrio\Desktop\GTA SAMP\BDP2\BDP\filterscripts\V-Admin.pwn(1907) : error 001: expected token: ";", but found "]"
E:\Documents and Settings\Usuбrio\Desktop\GTA SAMP\BDP2\BDP\filterscripts\V-Admin.pwn(1907) : fatal error 107: too many error messages on one line
Reply
#2

o problema nao e necessariamente no new nome,mais sim na linha logo acima,veja:
pawn Код:
...
                if(IsPlayerInAnyVehicle(i))
                    new nome[MAX_PLAYER_NAME]; //aki
...
e perceba que voce nem abriu uma chave para esse if,entao o certo seria:
pawn Код:
if(strcmp(cmd, "/rc", true) == 0)
    {
        if(IsPlayerAdmin(playerid));
        {
            for(new i = 0; i <= MAX_PLAYERS; i++)
            {
                if(IsPlayerInAnyVehicle(i))
                {
                    new nome[MAX_PLAYER_NAME]; //aki
                    GetPlayerName(playerid, nome, MAX_PLAYER_NAME);
                    new msg[80];
                    format(msg, sizeof(msg), "O Admin %s Respawnou os veiculos", nome);
                    SendClientMessageToAll(-1, msg);
                    for(new v = 0; v <= MAX_VEHICLES; v++)
                    {
                        SetVehicleToRespawn(v);
                    }
            }   }
        }
        return 1;
    }
Reply
#3

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
o problema nao e necessariamente no new nome,mais sim na linha logo acima,veja:
pawn Код:
...
                if(IsPlayerInAnyVehicle(i))
                    new nome[MAX_PLAYER_NAME]; //aki
...
e perceba que voce nem abriu uma chave para esse if,entao o certo seria:
pawn Код:
if(strcmp(cmd, "/rc", true) == 0)
    {
        if(IsPlayerAdmin(playerid));
        {
            for(new i = 0; i <= MAX_PLAYERS; i++)
            {
                if(IsPlayerInAnyVehicle(i))
                {
                    new nome[MAX_PLAYER_NAME]; //aki
                    GetPlayerName(playerid, nome, MAX_PLAYER_NAME);
                    new msg[80];
                    format(msg, sizeof(msg), "O Admin %s Respawnou os veiculos", nome);
                    SendClientMessageToAll(-1, msg);
                    for(new v = 0; v <= MAX_VEHICLES; v++)
                    {
                        SetVehicleToRespawn(v);
                    }
            }   }
        }
        return 1;
    }
pawn Код:
if(!strcmp(cmdtext, "/rc", true))
    {
        if(IsPlayerAdmin(playerid))
        {
            for(new i = 0; i <= MAX_PLAYERS; i++)
            {
                if(IsPlayerInAnyVehicle(i))
                {
                    new nome[MAX_PLAYER_NAME]; //aki
                    GetPlayerName(playerid, nome, MAX_PLAYER_NAME);
                    new msg[80];
                    format(msg, sizeof(msg), "O Admin %s Respawnou os veiculos", nome);
                    SendClientMessageToAll(-1, msg);
                    for(new v = 0; v <= MAX_VEHICLES; v++)
                    {
                        SetVehicleToRespawn(v);
                    }
                }
            }
        }
        return 1;
    }
Reply
#4

LOL, agora que tф vendo.. viajei na maionese .-.
Reply
#5

mano, eu sempre olho bem nas chaves, pq elas sгo as que causam erros, tente dar uma olhada antes de pedir ajuda.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)