[help]Can someone sort this out for me???
#1

Код:
: error 017: undefined symbol "Adminvariable"
: warning 215: expression has no effect
 : error 001: expected token: ";", but found ")" 
: error 029: invalid expression, assumed zero 
: fatal error 107
: too many error messages on one line
Код:
if(Adminvariable(playerid, == 1)
Reply
#2

I just lol'ed...

What do you need help with? Create variable, such as this

pawn Код:
//Top of script
new Adminvariable[MAX_PLAYERS];
//Checking
if(Admnvariable[playerid] == 1)
Reply
#3

no just fix the with the errors i gave you pleaseeee!
Reply
#4

You can't do it that way, if you had actual basic knowledge of pawn. The way you did it makes it look like a function. You HAVE to do it basicly the way I showed you.
Reply
#5

so i put this in the top of the script
Код:
new Adminvariable[MAX_PLAYERS];
EDIT: this is want im trying to do...
Код:
public OnPlayerText(playerid, text[])
{
    new string[128], name[MAX_PLAYER_NAME];
    if(Adminvariable(playerid, == 1)
    {
        format(string, sizeof(string), "[V.I.P] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_GREEN, string);
        return 0;
    }
    if(Adminvariable[playerid] == 2)
    {
        format(string, sizeof(string), "[Moderator] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_GREEN, string);
        return 0;
    }
    else if(Adminvariable[playerid] >= 3)
    {
        format(string, sizeof(string), "[%d Admin] %s: %s", Admincariable[playerid], GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_ORANGE, string);
        return 0;
    }
    else if(Adminvariable[playerid] == 0)
    {
        format(string, sizeof(string), "[Player] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_WHITE, string);
        return 0;
    }
    else if(Leadervariable[playerid] == 1)
    {
        format(string, sizeof(string), "[Leader] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_BLUE, string);
        return 0;
    }

	if(IsPlayerConnected(playerid))
    {
        new msg[256];
        format(msg,sizeof(msg),"(%d){FFFFFF} %s",playerid, text);
        SendPlayerMessageToAll(playerid,msg);
        return 0;
    }
	return 1;
}
Reply
#6

bump ima goto sleep i hope when i wake up this is solved :P...
Reply
#7

Fixed a few things, but yea, it's like this:

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128], name[MAX_PLAYER_NAME];
    if(Adminvariable[playerid] == 1)
    {
        format(string, sizeof(string), "[V.I.P] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_GREEN, string);
        return 0;
    }
    if(Adminvariable[playerid] == 2)
    {
        format(string, sizeof(string), "[Moderator] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_GREEN, string);
        return 0;
    }
    else if(Adminvariable[playerid] >= 3)
    {
        format(string, sizeof(string), "[%d Admin] %s: %s", Adminvariable[playerid], GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_ORANGE, string);
        return 0;
    }
    else if(Adminvariable[playerid] == 0)
    {
        format(string, sizeof(string), "[Player] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_WHITE, string);
        return 0;
    }
    else if(Leadervariable[playerid] == 1)
    {
        format(string, sizeof(string), "[Leader] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_BLUE, string);
        return 0;
    }

    if(IsPlayerConnected(playerid))
    {
        new msg[256];
        format(msg,sizeof(msg),"(%d){FFFFFF} %s",playerid, text);
        SendPlayerMessageToAll(playerid,msg);
        return 0;
    }
    return 1;
}
Yes, use the new Adminvariable[MAX_PLAYERS]; at the top for a global variable.

For more smoothness and professionalism in the script, I suggest using enums for your playerinfo. If you already are, simply add the Admin variable in it.
Reply
#8

pawn Код:
SendClientMessageToAll(playerid, COLOR_BLUE, string);
DAFUQ?!
it should be
pawn Код:
SendClientMessageToAll(COLOR_BLUE,string);
Also, use switch().
Reply
#9

Код:
C:\Users\x\Desktop\Sky Stunting\gamemodes\2222backup.pwn(97) : error 035: argument type mismatch (argument 2)
C:\Users\x\Desktop\Sky Stunting\gamemodes\2222backup.pwn(103) : error 035: argument type mismatch (argument 2)
C:\Users\x\Desktop\Sky Stunting\gamemodes\2222backup.pwn(109) : error 035: argument type mismatch (argument 2)
C:\Users\x\Desktop\Sky Stunting\gamemodes\2222backup.pwn(112) : error 017: undefined symbol "Leadervariable"
C:\Users\x\Desktop\Sky Stunting\gamemodes\2222backup.pwn(112) : warning 215: expression has no effect
C:\Users\x\Desktop\Sky Stunting\gamemodes\2222backup.pwn(112) : error 001: expected token: ";", but found "]"
C:\Users\x\Desktop\Sky Stunting\gamemodes\2222backup.pwn(112) : error 029: invalid expression, assumed zero
C:\Users\x\Desktop\Sky Stunting\gamemodes\2222backup.pwn(112) : fatal error 107: too many error messages on one line
AH CMON HELP ME.

Код:
public OnPlayerText(playerid, text[])
{
    new string[128], name[MAX_PLAYER_NAME];
    if(Adminvariable[playerid] == 1)
    {
        format(string, sizeof(string), "[V.I.P] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, 0x0F5E0C,string);
        return 0;
    }
    if(Adminvariable[playerid] == 2)
    {
        format(string, sizeof(string), "[Moderator] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, 0xBA4141,string);
        return 0;
    }
    else if(Adminvariable[playerid] >= 3)
    {
        format(string, sizeof(string), "[%d Admin] %s: %s", Adminvariable[playerid], GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, 0x969336,string);
        return 0;
    }
    else if(Leadervariable[playerid] == 1)
    {
        format(string, sizeof(string), "[Leader] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, 0x0011FF,string);
        return 0;
    }

    if(IsPlayerConnected(playerid))
    {
        new msg[256];
        format(msg,sizeof(msg),"(%d){FFFFFF} %s",playerid, text);
        SendPlayerMessageToAll(playerid,msg);
        return 0;
    }

	if(IsPlayerConnected(playerid))
    {
        new msg[256];
        format(msg,sizeof(msg),"(%d){FFFFFF} %s",playerid, text);
        SendPlayerMessageToAll(playerid,msg);
        return 0;
    }
	return 1;
}
Reply
#10

Try this:

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128], name[MAX_PLAYER_NAME];
    if(Adminvariable[playerid] == 1)
    {
        format(string, sizeof(string), "[V.I.P] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, 0x0F5E0CFF,string);
        return 0;
    }
    if(Adminvariable[playerid] == 2)
    {
        format(string, sizeof(string), "[Moderator] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, 0xBA4141FF,string);
        return 0;
    }
    else if(Adminvariable[playerid] >= 3)
    {
        format(string, sizeof(string), "[%d Admin] %s: %s", Adminvariable[playerid], GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, 0x969336FF,string);
        return 0;
    }
    else if(Leadervariable[playerid] == 1)
    {
        format(string, sizeof(string), "[Leader] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, 0x0011FFFF,string);
        return 0;
    }
    if(IsPlayerConnected(playerid))
    {
        new msg[256];
        format(msg,sizeof(msg),"(%d){FFFFFF} %s",playerid, text);
        SendPlayerMessageToAll(playerid, 0xFFFFFFFF, msg);
        return 0;
    }
    return 1;
}
And, can't you be a good fellow and actually show us the lines the errors are on? We can't help you if you don't, unless you want us to look all of it over, which will take us longer. Just a future tip, show the lines.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)