SA-MP Forums Archive
boombox errors help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: boombox errors help (/showthread.php?tid=614655)



boombox errors help - Jensenn - 10.08.2016

Код:
C:\Users\user\Desktop\server\server\gamemodes\raven.pwn(7958) : error 035: argument type mismatch (argument 3)
C:\Users\user\Desktop\server\server\gamemodes\raven.pwn(7959) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\server\server\gamemodes\raven.pwn(7967) : error 017: undefined symbol "string2"
C:\Users\user\Desktop\server\server\gamemodes\raven.pwn(7967) : error 017: undefined symbol "string2"
C:\Users\user\Desktop\server\server\gamemodes\raven.pwn(7967) : error 029: invalid expression, assumed zero
C:\Users\baran\Desktop\server\server\gamemodes\raven.pwn(7967) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Код:
CMD:boombox(playerid, params[])
{
    new string[128], bName[MAX_PLAYER_NAME];
 	GetPlayerName(playerid, bName, sizeof(bName));
    
    
    if(PlayerInfo[playerid][pDonator] < 3)
	    return SendClientMessage(playerid, COLOR_GREY, "Bu komutu yalnızca Elmas VIP olanlar kullanabilir.");

    if(!Boombox[playerid])
    {
        if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /boombox [Mьzik URL]");
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                    if(Boombox[i])
                    {
                        if(IsPlayerInRangeOfPoint(playerid, 30, bpos[i][0], bpos[i][1], bpos[i][2]))
                        {
                            SendClientMessage(playerid, COLOR_GREY, "Burada zaten bir boombox kutusu var, lьtfen başka bir yere yerleştirin!");
                            return 1;
                        }
                    }
            }
        }
       	new string2[128];
        Boombox[playerid] = 1;
        ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
		format(string2, sizeof(string2), "%s mьzik kutusunu yere bıraktı.", bName);
		ProxDetector(15.0, playerid, string2, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        GetPlayerPos(playerid, bpos[playerid][0], bpos[playerid][1], bpos[playerid][2]); bpos[playerid][2] = bpos[playerid][2] - 1;
        GetPlayerFacingAngle(playerid, bpos[playerid][3]); bpos[playerid][3] = bpos[playerid][3] +180;
        BoomboxObject[playerid] = CreateDynamicObject(2103, bpos[playerid][0], bpos[playerid][1], bpos[playerid][2], 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid));
        format(BoomboxURL[playerid], 256, "%s", params);

		//SendNearbyMessage(playerid, 15, string2, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
		format(string, sizeof(string), "Boombox Owner: %s\nUse /setboombox to set your boombox\n/pickupboombox to Pick up your boombox", bName);
		SetPVarInt(playerid, "bbIkon", _:CreateDynamic3DTextLabel(string, -1, bpos[0], bpos[1], bpos[2] +0.6, 5, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
		SetPVarInt(playerid, "bbYer", CreateDynamicSphere(bpos[0], bpos[1], bpos[2], 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
		SetPVarInt(playerid, "bbInt", GetPlayerInterior(playerid));
		SetPVarInt(playerid, "bbVW", GetPlayerVirtualWorld(playerid));
    }
    else
    {
        Boombox[playerid] = 0;
        ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
		format(string2, sizeof(string2), "%s mьzik kutusunu kaldırdı.", bName);
		ProxDetector(15.0, playerid, string2, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        DestroyDynamicObject(BoomboxObject[playerid]);
        format(BoomboxURL[playerid], 256, "");
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(BoomboxPlayer[i] == playerid)
                {
                    BoomboxStream[i] = 0;
                    BoomboxPlayer[i] = -1;
                    StopAudioStreamForPlayer(i);
                    DestroyDynamicObject(GetPVarInt(playerid, "bbYer"));
      				DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "bbIkon"));
                    SendClientMessage(i, COLOR_GREY, "Boombox sahibi mьziği kapatıp, boombox kutusunu aldı!");
                }
            }
        }
    }
    return 1;
}



Re: boombox errors help - Shinja - 10.08.2016

string2 is defined inside a statement (if... new string2), but used in other statements
Make it global, near string and bName


Re: boombox errors help - Jensenn - 10.08.2016

Quote:
Originally Posted by Shinja
Посмотреть сообщение
string2 is defined inside a statement (if... new string2), but used in other statements
Make it global, near string and bName
Код:
C:\Users\server\Desktop\server\server\gamemodes\raven.pwn(7957) : error 035: argument type mismatch (argument 3)
C:\Users\server\Desktop\server\server\gamemodes\raven.pwn(7958) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
lines 7957-7958
Код:
		SetPVarInt(playerid, "bbIkon", _:CreateDynamic3DTextLabel(string, -1, bpos[0], bpos[1], bpos[2] +0.6, 5, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
		SetPVarInt(playerid, "bbYer", CreateDynamicSphere(bpos[0], bpos[1], bpos[2], 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));



Re: boombox errors help - Shinja - 10.08.2016

I don't get what you mean't in this 2 lines, btw SetPVarInt usage is
PHP код:
SetPVarInt(playeridvarname[], int_value



Re: boombox errors help - Jensenn - 10.08.2016

Quote:
Originally Posted by Shinja
Посмотреть сообщение
I don't get what you mean't in this 2 lines, btw SetPVarInt usage is
PHP код:
SetPVarInt(playeridvarname[], int_value
i dont know, what should i do


Re: boombox errors help - Shinja - 10.08.2016

I don't know what you want it to do, maybe only like that?
PHP код:
CreateDynamic3DTextLabel(string, -1bpos[0], bpos[1], bpos[2] +0.65GetPlayerVirtualWorld(playerid),  GetPlayerInterior(playerid));
        
CreateDynamicSphere(bpos[0], bpos[1], bpos[2], 30.0GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); 



Re: boombox errors help - Jensenn - 10.08.2016

Quote:
Originally Posted by Shinja
Посмотреть сообщение
I don't know what you want it to do, maybe only like that?
PHP код:
CreateDynamic3DTextLabel(string, -1bpos[0], bpos[1], bpos[2] +0.65GetPlayerVirtualWorld(playerid),  GetPlayerInterior(playerid));
        
CreateDynamicSphere(bpos[0], bpos[1], bpos[2], 30.0GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); 
Код:
C:\Users\server\Desktop\server\server\gamemodes\raven.pwn(7957) : error 035: argument type mismatch (argument 3)
C:\Users\server\Desktop\server\server\gamemodes\raven.pwn(7958) : error 035: argument type mismatch (argument 1)
nothing's changed


Re: boombox errors help - Shinja - 10.08.2016

How are you declaring bpos?
EDIT: [playerid] was missing
PHP код:
CreateDynamic3DTextLabel(string, -1bpos[playerid][0], bpos[playerid][1], bpos[playerid][2] +0.65GetPlayerVirtualWorld(playerid),  GetPlayerInterior(playerid));
        
CreateDynamicSphere(bpos[playerid][0], bpos[playerid][1], bpos[playerid][2], 30.0GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); 



Re: boombox errors help - Jensenn - 10.08.2016

Quote:
Originally Posted by Shinja
Посмотреть сообщение
How are you declaring bpos?
EDIT: [playerid] was missing
PHP код:
CreateDynamic3DTextLabel(string, -1bpos[playerid][0], bpos[playerid][1], bpos[playerid][2] +0.65GetPlayerVirtualWorld(playerid),  GetPlayerInterior(playerid));
        
CreateDynamicSphere(bpos[playerid][0], bpos[playerid][1], bpos[playerid][2], 30.0GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); 
work but wrong work

http://prnt.sc/c46bo3


Re: boombox errors help - Shinja - 10.08.2016

Get back your original code with fixing [playerid] issue
PHP код:
        SetPVarInt(playerid"bbIkon"_:CreateDynamic3DTextLabel(string, -1bpos[playerid][0], bpos[playerid][1], bpos[playerid][2] +0.65, .worldid GetPlayerVirtualWorld(playerid), .interiorid GetPlayerInterior(playerid)));
        
SetPVarInt(playerid"bbYer"CreateDynamicSphere(bpos[playerid][0], bpos[playerid][1], bpos[playerid][2], 30.0GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid))); 
I'll say it again, idk what you wanna do