18.07.2013, 02:34
(
Последний раз редактировалось jasonsmith; 18.07.2013 в 03:41.
)
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
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;