undefined symbol "PlayerInfo"
#1

When I try to compile this:
pawn Код:
#define FILTERSCRIPT


// DJ Script by ZombieNest
// Thanks to BC-RP for the stream code


#include <a_samp>
#include <zcmd>
#include <sscanf>
#include <foreach>


#define COLOR_LIGHTRED 0xAA3333AA


public OnFilterScriptInit()
{
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  ");
    print(" <><><><>DJ Filterscript Loaded by ZombieNest<><><><><><><><><>  ");
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  ");
    print(" <><><><>DJ Filterscript Unloaded by ZombieNest<><><><><><><><><>  ");
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n");
    return 1;
}

// For the stream thing thanks to BcRp  by bustern
CMD:dj(playerid, params[])
{
    new string[128];
    if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, -1, "[Usage]: /dj [url/help/stop/credits]");
    if(!strcmp(params, "help", true, 4))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Help:{FAD008}DJ is a system for players to play songs offically.");
        SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Help:{FAD008}All players will be able to hear the song. Not only you!");
        return 1;
    }
    if(!strcmp(params, "stop", true, 4))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Stopped.");
        StopAudioStreamForPlayer(playerid);
        return 1;
    }
    if(!strcmp(params, "credits", true, 4))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Thanks to:");
        SendClientMessage(playerid, -1, "{0033FF}Bustern for the Stream system");
        SendClientMessage(playerid, -1, "{FAD009}Kevin Hendrews a.k.a ZombieNest for editing");
        return 1;
    }
    if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    format(string, sizeof(string), "{FFFFFF}>> {0033FF}[DJ]{FFFFFF}: A Player is now DJing {FAD008} ( /dj help for more)");
    SendClientMessageToAll(0xFFFFFFAA,string);
    foreach(Player, i)
    {
    PlayAudioStreamForPlayer(i, params);
    }
    return 1;
}
And the ORIGINAL one is this:
pawn Код:
#define FILTERSCRIPT


// DJ Script by ZombieNest
// Thanks to BC-RP for the stream code


#include <a_samp>
#include <zcmd>
#include <sscanf>
#include <foreach>


#define COLOR_LIGHTRED 0xAA3333AA


public OnFilterScriptInit()
{
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  ");
    print(" <><><><>DJ Filterscript Loaded by ZombieNest<><><><><><><><><>  ");
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  ");
    print(" <><><><>DJ Filterscript Unloaded by ZombieNest<><><><><><><><><>  ");
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n");
    return 1;
}

// For the stream thing thanks to BcRp  by bustern
CMD:dj(playerid, params[])
{
    new string[128];
    if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, -1, "[Usage]: /dj [url/help/stop/credits]");
    if(!strcmp(params, "help", true, 4))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Help:{FAD008}DJ is a system for players to play songs offically.");
        SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Help:{FAD008}All players will be able to hear the song. Not only you!");
        return 1;
    }
    if(!strcmp(params, "stop", true, 4))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Stopped.");
        StopAudioStreamForPlayer(playerid);
        return 1;
    }
    if(!strcmp(params, "credits", true, 4))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Thanks to:");
        SendClientMessage(playerid, -1, "{0033FF}Bustern for the Stream system");
        SendClientMessage(playerid, -1, "{FAD009}Kevin Hendrews a.k.a ZombieNest for editing");
        return 1;
    }
    //if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    format(string, sizeof(string), "{FFFFFF}>> {0033FF}[DJ]{FFFFFF}: A Player is now DJing {FAD008} ( /dj help for more)");
    SendClientMessageToAll(0xFFFFFFAA,string);
    foreach(Player, i)
    {
    PlayAudioStreamForPlayer(i, params);
    }
    return 1;
}
AND When I use the first code, I get this errors:
Quote:

error 017: undefined symbol "PlayerInfo"
C:\Users\D\Desktop\dj.pwn(57) : warning 215: expression has no effect
C:\Users\D\Desktop\dj.pwn(57) : error 001: expected token: ";", but found "]"
C:\Users\D\Desktop\dj.pwn(57) : error 029: invalid expression, assumed zero
C:\Users\D\Desktop\dj.pwn(57) : fatal error 107: too many error messages on one line

Can anyone help me?
Reply
#2

Its because "playerid" isn't defined in that filterscript.
You should either define it or try to add that filterscript to your gamemode as [Admin] and many things arent defined.
Reply
#3

How to define it, maybe, you can help me?
Reply
#4

Quote:
Originally Posted by DGRP
Посмотреть сообщение
How to define it, maybe, you can help me?
I think that you are using Raven's script GM. However, the defines are there. I really suggest you to make that command only for the ones who have /rcon logined instead of making it for admins that are 1337....'
Since defining them all would mess up. As I think that you wont be able to just add that FS to your GM( I mean copy-pasting it to your GM but that wont work since your commands are not using ZCMD)
Reply
#5

Nah, not using raven's... I want only the admins can use them/Faction members.
Reply
#6

You have to create enum,

pawn Код:
//example
enum pinfo
{
pAdmin,
score,
money;
};
new PlayerInfo[MAX_PLAYERS][pinfo];
Reply
#7

Fixed, now how do I make it so only SANews can use the command?
pawn Код:
#define FILTERSCRIPT


// DJ Script by ZombieNest
// Thanks to BC-RP for the stream code


#include <a_samp>
#include <zcmd>
#include <sscanf>
#include <foreach>
#define COLOR_LIGHTRED 0xAA3333AA
#define COLOR_GREY 0xAFAFAFAA
enum pinfo
{
pAdmin,
score,
money,
pMember,
};
new PlayerInfo[MAX_PLAYERS][pinfo];

public OnFilterScriptInit()
{
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  ");
    print(" <><><><>DJ Filterscript Loaded by ZombieNest<><><><><><><><><>  ");
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  ");
    print(" <><><><>DJ Filterscript Unloaded by ZombieNest<><><><><><><><><>  ");
    print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n");
    return 1;
}

// For the stream thing thanks to BcRp  by bustern
CMD:dj(playerid, params[])
{
    new string[128];
    if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, -1, "[Usage]: /dj [url/help/stop/credits]");
    if(!strcmp(params, "help", true, 4))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Help:{FAD008}DJ is a system for players to play songs offically.");
        SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Help:{FAD008}All players will be able to hear the song. Not only you!");
        return 1;
    }
    if(!strcmp(params, "stop", true, 4))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Stopped.");
        StopAudioStreamForPlayer(playerid);
        return 1;
    }
    if(!strcmp(params, "credits", true, 4))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Thanks to:");
        SendClientMessage(playerid, -1, "{0033FF}Bustern for the Stream system");
        SendClientMessage(playerid, -1, "{FAD009}Kevin Hendrews a.k.a ZombieNest for editing");
        return 1;
    }
    if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    format(string, sizeof(string), "{FFFFFF}>> {0033FF}[DJ]{FFFFFF}: A Player is now DJing {FAD008} ( /dj help for more)");
    SendClientMessageToAll(0xFFFFFFAA,string);
    foreach(Player, i)
    {
    PlayAudioStreamForPlayer(i, params);
    }
    return 1;
}
I added the pMember, in the ENUM
Reply
#8

When it comes to the end variable in the enum you're not supposed to put coma after it

pawn Код:
enum pinfo
{
pAdmin,
score,
money,
pMember; // in this line you shouldn't put coma
};
Reply
#9

Quote:
Originally Posted by DGRP
Посмотреть сообщение
Nah, not using raven's... I want only the admins can use them/Faction members.
Make the command in the GM not in a filterscript, because your gamemode has the saving system and loading system in it(I hope) so it'll be easier to define the playerinfo.
Reply
#10

-Editted-
nvm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)