Help with /BoomBox
#1

I can't get it to work in my script'
an i dont know what to do it's for my rp server an im trying to add a /giftbox cmd aswell.
All help is needed please
Код:
 CMD:shopboombox(playerid, params[])
{
	if (PlayerInfo[playerid][pShopTech][pAdmin] < 1)
	{
		SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
		return 1;
	}

	new giveplayerid, invoice;
	if(sscanf(params, "ui", giveplayerid, invoice)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /shopboombox [player] [invoice #]");
	new string[128];

	if(PlayerInfo[giveplayerid][pBoombox] == 1)
	{
	    PlayerInfo[giveplayerid][pBoombox] = 0;
    	format(string, sizeof(string), "Your boombox has been taken by Shop Tech %s. ", GetPlayerNameEx(playerid));
		SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
		format(string, sizeof(string), "[SHOPBOOMBOX] %s has taken %s boombox - Invoice %d", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), invoice);
		SendClientMessageEx(playerid, COLOR_GRAD1, string);
		Log("logs/shoplog.log", string);
	}
	else
	{
		PlayerInfo[giveplayerid][pBoombox] = 1;
    	format(string, sizeof(string), "You have been given a boombox from Shop Tech %s. ", GetPlayerNameEx(playerid));
		SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
		format(string, sizeof(string), "[SHOPBOOMBOX] %s has given %s a boombox - Invoice %d", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), invoice);
		SendClientMessageEx(playerid, COLOR_GRAD1, string);
		Log("logs/shoplog.log", string);
	}
public OnPlayerEnterDynamicArea(playerid, areaid)
{
	foreach(Player, i)
	{
	    if(GetPVarType(i, "pBoomBoxArea"))
	    {
	        if(areaid == GetPVarInt(i, "pBoomBoxArea"))
	        {
	            new station[256];
	            GetPVarString(i, "pBoomBoxStation", station, sizeof(station));
	            if(!isnull(station))
				{
					PlayAudioStreamForPlayerEx(playerid, station, GetPVarFloat(i, "pBoomBoxX"), GetPVarFloat(i, "pBoomBoxY"), GetPVarFloat(i, "pBoomBoxZ"), 30.0, 1);
	            }
				return 1;
	        }
	    }
	}
	if(areaid == audiourlid)
	{
	    PlayAudioStreamForPlayerEx(playerid, audiourlurl, audiourlparams[0], audiourlparams[1], audiourlparams[2], audiourlparams[3], 1);
	}
	return 1;
}

public OnPlayerLeaveDynamicArea(playerid, areaid)
{
    foreach(Player, i)
	{
	    if(GetPVarType(i, "pBoomBoxArea"))
	    {
	        if(areaid == GetPVarInt(i, "pBoomBoxArea"))
	        {
	            StopAudioStreamForPlayerEx(playerid);
				return 1;
	        }
	    }
	}
	if(areaid == audiourlid)
	{
	    StopAudioStreamForPlayerEx(playerid);
	}
	return 1;
}
	return 1;
Reply
#2

Removed to fucking long
Reply
#3

so does it have any errors, if not, what does it show in game?
Reply
#4

Quote:
Originally Posted by dominik523
Посмотреть сообщение
so does it have any errors, if not, what does it show in game?
It says this when i try my /boombox script an /giftbox
Код:
C:\Users\Parent\Desktop\pawno\gamemodes\MXRP.pwn(95921) : error 021: symbol already defined: "cmd_shopboombox"
C:\Users\Parent\Desktop\pawno\gamemodes\MXRP.pwn(95922) : error 001: expected token: ")", but found "["
C:\Users\Parent\Desktop\pawno\gamemodes\MXRP.pwn(95922) : error 029: invalid expression, assumed zero
C:\Users\Parent\Desktop\pawno\gamemodes\MXRP.pwn(95922) : warning 215: expression has no effect
C:\Users\Parent\Desktop\pawno\gamemodes\MXRP.pwn(95922) : error 001: expected token: ";", but found "]"
C:\Users\Parent\Desktop\pawno\gamemodes\MXRP.pwn(95922) : fatal error 107: too many error messages on one line

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


5 Errors.
Reply
#5

Can you please tell us the lines 95920 to 95925
Reply
#6

Quote:
Originally Posted by SsHady
Посмотреть сообщение
Can you please tell us the lines 95920 to 95925
}
CMDhopboombox(playerid, params[])
{
if (PlayerInfo[playerid][pShopTech][pAdmin] < 1)
{
SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
return 1;
Reply
#7

Quote:
Originally Posted by jasonsmith
Посмотреть сообщение
}
CMDhopboombox(playerid, params[])
{
if (PlayerInfo[playerid][pShopTech][pAdmin] < 1)
{
SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
return 1;
Heres a pic to see what i have http://gyazo.com/09c8ed50730525e685dd2930421419ed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)