Commands not working in filterscript
#1

What's wrong with this goddamn filterscript? I can't get it to work. 6 months ago commands were working with ZCMD, but music didn't stream, now commands aren't working at all (be it ZCMD or dc_cmd).
It's compiling without errors or warnings at all.

PHP код:
#define FILTERSCRIPT
// Incl
#include <a_samp>
#include <dc_cmd>
#include <streamer>
#include <foreach>
#include <sscanf2>
// Defs
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_RED 0xFF0000FF
#define COLOR_LIGHTBLUE 0x33CCFFFF
#define COLOR_GREY 0xAFAFAFFF
public OnPlayerConnect(playerid)
{
    
DeletePVar(playerid"BoomboxObject"); DeletePVar(playerid"BoomboxURL");
    
DeletePVar(playerid"bposX"); DeletePVar(playerid"bposY"); DeletePVar(playerid"bposZ"); DeletePVar(playerid"bboxareaid");
    
DeletePVar(playerid"author");
    if(
IsValidDynamicObject(GetPVarInt(playerid"BoomboxObject"))) DestroyDynamicObject(GetPVarInt(playerid"BoomboxObject"));
    return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
    if(
GetPVarType(playerid"BoomboxObject"))
    {
        
DestroyDynamicObject(GetPVarInt(playerid"BoomboxObject"));
        
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid"author"));
        if(
GetPVarType(playerid"bboxareaid"))
        {
               foreach(new 
Player)
            {
                if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"bboxareaid")))
                {
                    
StopAudioStreamForPlayer(i);
                }
            }
        }
    }
    return 
1;
}
CMD:speaker(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"[GrandProject] Äëÿ äîñòóïà ê äàííîé êîìàíäå íóæåí êëèðåíñ RCON óðîâíÿ.");
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    new 
string[128];
    if(!
GetPVarType(playerid"BoomboxObject"))
    {
        if(
sscanf(params"s[256]"params)) return SendClientMessage(playeridCOLOR_RED"[SH-SS][Ïîìîùü]: /speaker [URL]");
        foreach(new 
Player)
        {
            if(
GetPVarType(i"BoomboxObject"))
            {
                if(
IsPlayerInRangeOfPoint(playerid40.0GetPVarFloat(i"bposX"), GetPVarFloat(i"bposY"), GetPVarFloat(i"bposZ")))
                {
                    
SendClientMessage(playeridCOLOR_GREY"[SH-SS] Ðÿäîì ãäå-òî óæå åñòü ñïèêåð. Ïîñòàâüòå ãäå-íèáóäü â äðóãîì ìåñòå.");
                    return 
1;
                }
            }
        }
        new 
Float:xFloat:yFloat:zFloat:a;
        
GetPlayerPos(playeridxyz); GetPlayerFacingAngle(playerida);
        
SetPVarInt(playerid"BoomboxObject"CreateDynamicObject(2103xyz0.00.00.0));
        
format(stringsizeof(string), "{FFFFFF}[SH-SS] Êîëîíêó ïîñòàâèë\n{FF0000}êóðàòîð %s"name);
        
SetPVarInt(playerid"author"_:CreateDynamic3DTextLabel(string0xFFFFFFFFxy1.020));
        
SetPVarFloat(playerid"bposX"x); SetPVarFloat(playerid"bposY"y); SetPVarFloat(playerid"bposZ"z);
        
SetPVarInt(playerid"bboxareaid"CreateDynamicSphere(xyz40.0));
        
format(stringsizeof(string), "[SH-SS] Êîëîíêà âûñòàâëåíà íà âàøåé ïîçèöèè.");
        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
        
format(stringsizeof(string), "pos: %f, %f, %f pvarpos: %f, %f, %f"xyzGetPVarFloat(playerid"bposX"), GetPVarFloat(playerid"bposY"), GetPVarFloat(playerid"bposZ"));
        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
        
SetPVarString(playerid"BoomboxURL"params[0]);
        foreach(new 
Player)
        {
            if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"bboxareaid")))
            {
                
PlayAudioStreamForPlayer(i"http://air.radiorecord.ru:8101/rr_320"xyz30.01);
            }
        }
        if(
IsValidDynamicArea(GetPVarInt(playerid"bboxareaid"))) return SendClientMessage(playeridCOLOR_LIGHTBLUE"bboxareaid is valid");
        
format(stringsizeof(string), "Params BoomboxURL: %s"params[0]);
        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
    }
    else
    {
        
DestroyDynamicObject(GetPVarInt(playerid"BoomboxObject"));
        
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid"author"));
        
DeletePVar(playerid"BoomboxObject"); DeletePVar(playerid"BoomboxURL");
        
DeletePVar(playerid"bposX"); DeletePVar(playerid"bposY"); DeletePVar(playerid"bposZ");
        if(
GetPVarType(playerid"bboxareaid"))
        {
            foreach(new 
Player)
            {
                if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"bboxareaid")))
                {
                    
StopAudioStreamForPlayer(i);
                }
            }
            
DeletePVar(playerid"bboxareaid");
        }
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"[SH-SS] Ñïèêåð óáðàí.");
    }
    return 
1;
}
CMD:setmusic(playeridparams[])
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"[GrandProject] Äëÿ äîñòóïà ê äàííîé êîìàíäå íóæåí êëèðåíñ RCON óðîâíÿ.");
    if(!
GetPVarType(playerid"BoomboxObject")) return SendClientMessage(playeridCOLOR_GREY"[SH-SS] Ó Âàñ íåò ñïèêåðà.");
    if(
sscanf(params"s[256]"params)) return SendClientMessage(playeridCOLOR_WHITE"[SH-SS][Ïîìîùü]: /setmusic [URL]");
    
SendClientMessage(playeridCOLOR_GREY"[SH-SS] Ìóçûêà óñïåøíî èçìåíåíà.");
    foreach(new 
Player)
    {
        if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"bboxareaid")))
        {
            
PlayAudioStreamForPlayer(iparams[0], GetPVarFloat(playerid"bposX"), GetPVarFloat(playerid"bposY"), GetPVarFloat(playerid"bposZ"), 30.01);
        }
    }
    
SetPVarString(playerid"BoomboxURL"params);
    return 
1;
}
public 
OnPlayerEnterDynamicArea(playeridareaid)
{
    foreach(new 
Player)
    {
        if(
GetPVarType(i"bboxareaid"))
        {
            new 
station[256];
            
GetPVarString(i"BoomboxURL"stationsizeof(station));
            if(
areaid == GetPVarInt(i"bboxareaid"))
            {
                
PlayAudioStreamForPlayer(playeridstationGetPVarFloat(i"bposX"), GetPVarFloat(i"bposY"), GetPVarFloat(i"bposZ"), 30.01);
                return 
1;
            }
        }
    }
    return 
1;
}
public 
OnPlayerLeaveDynamicArea(playeridareaid)
{
    foreach(new 
Player)
    {
        if(
GetPVarType(i"bboxareaid"))
        {
            if(
areaid == GetPVarInt(i"bboxareaid"))
            {
                
StopAudioStreamForPlayer(playerid);
                return 
1;
            }
        }
    }
    return 
1;

Reply
#2

Replace the dc_cmd include with a ZCMD include and see if that yields any different results.

Also make sure you're actually loading the filterscript in your server.cfg file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)