[Ajuda] Erros
#1

Eai galera do forum Samp, Peзo a ajuda de vcs nesses erros, tentei mas nao consegui, nao entendo muiot de pawno, quem puder me ajudar ai muito obg
vlw e flw


pawn Код:
(45335) : warning 219: local variable "string" shadows a variable at a preceding level
(45338) : error 017: undefined symbol "params"
(45362) : error 017: undefined symbol "params"
(45365) : error 017: undefined symbol "params"
(45390) : error 017: undefined symbol "Boombox"
(45390) : warning 215: expression has no effect
(45390) : error 001: expected token: ";", but found "]"
(45390) : error 029: invalid expression, assumed zero
(45390) : fatal error 107: too many error messages on one line

pawn Код:
Codigo completo
    if(strcmp(cmd, "/boom", true) == 0)
    {
    new string[128];
    if(!GetPVarType(playerid, "BoomboxObject"))
    {
        if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /boombox [music url]");
        foreach(Player, i)
        {
            if(GetPVarType(i, "BoomboxObject"))
            {
                if(IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "bposX"), GetPVarFloat(i, "bposY"), GetPVarFloat(i, "bposZ")))
                {
                    SendClientMessage(playerid, COLOR_GREY, " There is another boombox nearby, place yours somewhere else.");
                    return 1;
                }
            }
        }

        new Float:x, Float:y, Float:z, Float:a;
        GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a);
        SetPVarInt(playerid, "BoomboxObject", CreateDynamicObject(2103, x, y, z, 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
        SetPVarFloat(playerid, "bposX", x); SetPVarFloat(playerid, "bposY", y); SetPVarFloat(playerid, "bposZ", z);
        SetPVarInt(playerid, "bboxareaid", CreateDynamicSphere(x, y, z, 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
        format(string, sizeof(string), " You have placed your boombox at your location.");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        foreach(Player, i)
        {
            if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "bboxareaid")))
            {
                PlayAudioStreamForPlayer(i, params, GetPVarFloat(playerid, "bposX"), GetPVarFloat(playerid, "bposY"), GetPVarFloat(playerid, "bposZ"), 30.0, 1);
            }
        }
        SetPVarString(playerid, "BoomboxURL", params);
    }
    else
    {
        DestroyDynamicObject(GetPVarInt(playerid, "BoomboxObject"));
        DeletePVar(playerid, "BoomboxObject"); DeletePVar(playerid, "BoomboxURL");
        DeletePVar(playerid, "bposX"); DeletePVar(playerid, "bposY"); DeletePVar(playerid, "bposZ");
        if(GetPVarType(playerid, "bboxareaid"))
        {
            foreach(Player,i)
            {
                if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "bboxareaid")))
                {
                    StopAudioStreamForPlayer(i);
                    SendClientMessage(i, COLOR_GREY, " The boombox creator has removed his boombox.");
                }
            }
            DeletePVar(playerid, "bboxareaid");
        }
        SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have removed your boombox.");
    }
    return 1;
    }
    if(strcmp(cmd, "/nboom", true) == 0)
    {
    if(!Boombox[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You don't have a boombox placed.");
    if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /boomboxnext [music url]");
    SendClientMessage(playerid, COLOR_GREY, " You have changed the music your boombox is playing.");
    foreach(Player, i)
    {
        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "bboxareaid")))
        {
            PlayAudioStreamForPlayer(i, params, GetPVarFloat(playerid, "bposX"), GetPVarFloat(playerid, "bposY"), GetPVarFloat(playerid, "bposZ"), 30.0, 1);
        }
    }
    SetPVarString(playerid, "BoomboxURL", params);
    return 1;
    }
Reply
#2

usa zcmd
Reply
#3

Agora deu esses erros aqui

pawn Код:
(45334) : error 029: invalid expression, assumed zero
(45334) : error 017: undefined symbol "cmd_Boo"
(45334) : error 029: invalid expression, assumed zero
(45334) : fatal error 107: too many error messages on one line
linha do erro

CMD:Boo(playerid, params[])
Reply
#4

Quote:
Originally Posted by Vinicin
Посмотреть сообщение
Agora deu esses erros aqui

pawn Код:
(45334) : error 029: invalid expression, assumed zero
(45334) : error 017: undefined symbol "cmd_Boo"
(45334) : error 029: invalid expression, assumed zero
(45334) : fatal error 107: too many error messages on one line
linha do erro

CMD:Boo(playerid, params[])
Vocк ta usando zcmd certo ? verifica se o cmd esta fora de qualquer CallBack
Reply
#5

Olhao codigo completo, nao ta faltando nada, e eu tou usando zcmd certa.

pawn Код:
CMD:boombox(playerid, params[])
    {
    new string[128];
    if(!GetPVarType(playerid, "BoomboxObject"))
    {
        if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /boombox [music url]");
        foreach(Player, i)
        {
            if(GetPVarType(i, "BoomboxObject"))
            {
                if(IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "bposX"), GetPVarFloat(i, "bposY"), GetPVarFloat(i, "bposZ")))
                {
                    SendClientMessage(playerid, COLOR_GREY, " There is another boombox nearby, place yours somewhere else.");
                    return 1;
                }
            }
        }

        new Float:x, Float:y, Float:z, Float:a;
        GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a);
        SetPVarInt(playerid, "BoomboxObject", CreateDynamicObject(2103, x, y, z, 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
        SetPVarFloat(playerid, "bposX", x); SetPVarFloat(playerid, "bposY", y); SetPVarFloat(playerid, "bposZ", z);
        SetPVarInt(playerid, "bboxareaid", CreateDynamicSphere(x, y, z, 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
        format(string, sizeof(string), " You have placed your boombox at your location.");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        foreach(Player, i)
        {
            if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "bboxareaid")))
            {
                PlayAudioStreamForPlayer(i, params, GetPVarFloat(playerid, "bposX"), GetPVarFloat(playerid, "bposY"), GetPVarFloat(playerid, "bposZ"), 30.0, 1);
            }
        }
        SetPVarString(playerid, "BoomboxURL", params);
    }
    else
    {
        DestroyDynamicObject(GetPVarInt(playerid, "BoomboxObject"));
        DeletePVar(playerid, "BoomboxObject"); DeletePVar(playerid, "BoomboxURL");
        DeletePVar(playerid, "bposX"); DeletePVar(playerid, "bposY"); DeletePVar(playerid, "bposZ");
        if(GetPVarType(playerid, "bboxareaid"))
        {
            foreach(Player,i)
            {
                if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "bboxareaid")))
                {
                    StopAudioStreamForPlayer(i);
                    SendClientMessage(i, COLOR_GREY, " The boombox creator has removed his boombox.");
                }
            }
            DeletePVar(playerid, "bboxareaid");
        }
        SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have removed your boombox.");
    }
    return 1;
}

// Boombox editing - Usage: /boomboxnext [url]
CMD:boomboxnext(playerid, params[])
{
    if(!Boombox[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You don't have a boombox placed.");
    if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /boomboxnext [music url]");
    SendClientMessage(playerid, COLOR_GREY, " You have changed the music your boombox is playing.");
    foreach(Player, i)
    {
        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "bboxareaid")))
        {
            PlayAudioStreamForPlayer(i, params, GetPVarFloat(playerid, "bposX"), GetPVarFloat(playerid, "bposY"), GetPVarFloat(playerid, "bposZ"), 30.0, 1);
        }
    }
    SetPVarString(playerid, "BoomboxURL", params);
    return 1;
    }
Reply
#6

Ajuda up up
Reply
#7

PHP код:
if(strcmp(cmd"/boom"true) == 0)
{
    new 
string[128], url[256];
    if(!
GetPVarType(playerid"BoomboxObject"))
    {
        if(
sscanf(cmd"s[256]"url)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /boombox [music url]");
        foreach(
Playeri)
        {
            if(
GetPVarType(i"BoomboxObject"))
            {
                if(
IsPlayerInRangeOfPoint(playerid30.0GetPVarFloat(i"bposX"), GetPVarFloat(i"bposY"), GetPVarFloat(i"bposZ")))
                {
                    
SendClientMessage(playeridCOLOR_GREY" There is another boombox nearby, place yours somewhere else.");
                    return 
1;
                }
            }
        }
        new 
Float:xFloat:yFloat:zFloat:a;
        
GetPlayerPos(playeridxyz); GetPlayerFacingAngle(playerida);
        
SetPVarInt(playerid"BoomboxObject"CreateDynamicObject(2103xyz0.00.00.0, .worldid GetPlayerVirtualWorld(playerid), .interiorid GetPlayerInterior(playerid)));
        
SetPVarFloat(playerid"bposX"x); SetPVarFloat(playerid"bposY"y); SetPVarFloat(playerid"bposZ"z);
        
SetPVarInt(playerid"bboxareaid"CreateDynamicSphere(xyz30.0GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
        
format(stringsizeof(string), " You have placed your boombox at your location.");
        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
        foreach(
Playeri)
        {
            if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"bboxareaid")))
            {
                
PlayAudioStreamForPlayer(iurlGetPVarFloat(playerid"bposX"), GetPVarFloat(playerid"bposY"), GetPVarFloat(playerid"bposZ"), 30.01);
            }
        }
        
SetPVarString(playerid"BoomboxURL"url);
    }
    else
    {
        
DestroyDynamicObject(GetPVarInt(playerid"BoomboxObject"));
        
DeletePVar(playerid"BoomboxObject"); DeletePVar(playerid"BoomboxURL");
        
DeletePVar(playerid"bposX"); DeletePVar(playerid"bposY"); DeletePVar(playerid"bposZ");
        if(
GetPVarType(playerid"bboxareaid"))
        {
            foreach(
Player,i)
            {
                if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"bboxareaid")))
                {
                    
StopAudioStreamForPlayer(i);
                    
SendClientMessage(iCOLOR_GREY" The boombox creator has removed his boombox.");
                }
            }
            
DeletePVar(playerid"bboxareaid");
        }
        
SendClientMessage(playeridCOLOR_LIGHTBLUE" You have removed your boombox.");
    }
    return 
1;

PHP код:
if(strcmp(cmd"/nboom"true) == 0)
{
    new 
url[256];
    if(!
Boombox[playerid]) return SendClientMessage(playeridCOLOR_GREY"You don't have a boombox placed.");
    if(
sscanf(cmd"s[256]"url)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /boomboxnext [music url]");
    
SendClientMessage(playeridCOLOR_GREY" You have changed the music your boombox is playing.");
    foreach(
Playeri)
    {
        if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"bboxareaid")))
        {
            
PlayAudioStreamForPlayer(iurlGetPVarFloat(playerid"bposX"), GetPVarFloat(playerid"bposY"), GetPVarFloat(playerid"bposZ"), 30.01);
        }
    }
    
SetPVarString(playerid"BoomboxURL"url);
    return 
1;

Reply
#8

Qual й o erro, e o cуdigo do erro...?
Vocк postou duas coisas completamente diferentes O.o

@EDIT no primeiro post, й porque vocк tб chamando params e esse variбvel nгo existe, como o membro acima citou, use CMD ao invйs de PARAMS, se vocк estiver com strtok ou com algum outro tipo de separador.
Reply
#9

Quote:
Originally Posted by Vinicin
Посмотреть сообщение
Agora deu esses erros aqui

pawn Код:
(45334) : error 029: invalid expression, assumed zero
(45334) : error 017: undefined symbol "cmd_Boo"
(45334) : error 029: invalid expression, assumed zero
(45334) : fatal error 107: too many error messages on one line
linha do erro

CMD:Boo(playerid, params[])
Atualize sua include zcmd, aqui estб o link da minha para download
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)