PDA

View Full Version : Help with /BoomBox


jasonsmith
18/07/2013, 02:34 AM
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;

jasonsmith
18/07/2013, 02:45 AM
Removed to fucking long

dominik523
18/07/2013, 08:17 AM
so does it have any errors, if not, what does it show in game?

jasonsmith
18/07/2013, 10:00 AM
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(9 5921) : error 021: symbol already defined: "cmd_shopboombox"
C:\Users\Parent\Desktop\pawno\gamemodes\MXRP.pwn(9 5922) : error 001: expected token: ")", but found "["
C:\Users\Parent\Desktop\pawno\gamemodes\MXRP.pwn(9 5922) : error 029: invalid expression, assumed zero
C:\Users\Parent\Desktop\pawno\gamemodes\MXRP.pwn(9 5922) : warning 215: expression has no effect
C:\Users\Parent\Desktop\pawno\gamemodes\MXRP.pwn(9 5922) : error 001: expected token: ";", but found "]"
C:\Users\Parent\Desktop\pawno\gamemodes\MXRP.pwn(9 5922) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

SsHady
18/07/2013, 12:48 PM
Can you please tell us the lines 95920 to 95925

jasonsmith
18/07/2013, 01:17 PM
Can you please tell us the lines 95920 to 95925

}
CMD:shopboombox(playerid, params[])
{
if (PlayerInfo[playerid][pShopTech][pAdmin] < 1)
{
SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
return 1;

jasonsmith
18/07/2013, 01:19 PM
}
CMD:shopboombox(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