Admins problem
#1

I have this command
Code:
if(strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Admini online");
for(new i=0;i<=MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(pAdmin[i] > 0)
{
format(string, sizeof(string), "%s [Level: %d]", RemoveUnderScore(i), pAdmin[i]);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
}
}
return 1;
}
and me these errors
Code:
E:\SA-MP Resources\RNT\gamemodes\RPG.pwn(517) : warning 204: symbol is assigned a value that is never used: "SkinOffSet"
E:\SA-MP Resources\RNT\gamemodes\RPG.pwn(582) : error 017: undefined symbol "pAdmin"
E:\SA-MP Resources\RNT\gamemodes\RPG.pwn(582) : warning 215: expression has no effect
E:\SA-MP Resources\RNT\gamemodes\RPG.pwn(582) : error 001: expected token: ";", but found "]"
E:\SA-MP Resources\RNT\gamemodes\RPG.pwn(582) : error 029: invalid expression, assumed zero
E:\SA-MP Resources\RNT\gamemodes\RPG.pwn(582) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

Try:

pawn Code:
if(strcmp(cmd, "/admins", true) == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Admini online");
for(new i=0;i<=MAX_PLAYERS;i++)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(i, pname, sizeof(pname));
if(pAdmin[i] >= 0)
{
format(string, sizeof(string), "%s [Level: %d]", pname(i), pAdmin[i]);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
return 1;
}
Reply
#3

pawn Code:
if(strcmp(cmd, "/admins", true) == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Admini online");
for(new i=0;i<=MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] > 0)
{
format(string, sizeof(string), "%s [Level: %d]", RemoveUnderScore(i), PlayerInfo[pAdmin]);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
}
return 1;
}
Reply
#4

You dont need IsPlayerConnected while doing a loop! The loop already checks if the players are online,so don't need it.

Also,RemoveUnderScore,wtf?How you manage to get the admins name if you don't use GetPlayerName?
Reply
#5

he just a newbie and never read something of scripting and also wtf padmin? maybe you meant PlayerInfo[playerid][pAdmin] ?
Reply
#6

Quote:
Originally Posted by mineralo
View Post
he just a newbie and never read something of scripting and also wtf padmin? maybe you meant PlayerInfo[playerid][pAdmin] ?
Yeah i tought the same thing.But this changes by how the admin system is scripted.

Ah,sorry for being rude.
Reply
#7

Quote:
Originally Posted by Logitech90
View Post
You dont need IsPlayerConnected while doing a loop! The loop already checks if the players are online,so don't need it.

Also,RemoveUnderScore,wtf?How you manage to get the admins name if you don't use GetPlayerName?
What? Looping does not check if the player is online, unless you use foreach.
Reply
#8

Quote:
Originally Posted by PrawkC
View Post
What? Looping doesn't not check if the player is online, unless you use foreach.
Serious?

Than why you're looping for all players?To see if they bought a new t-shirt?
Reply
#9

Quote:
Originally Posted by Logitech90
View Post
Serious?

Than why you're looping for all players?To see if they bought new tshirt?
You're truly an idiot, MAX_PLAYERS equates to 500, all you're doing is looping from 0-500, It doesn't automatically check if that player is online, its just running through the numbers.
Reply
#10

Quote:
Originally Posted by PrawkC
View Post
You're truly an idiot, MAX_PLAYERS equates to 500, all you're doing is looping from 0-500, It doesn't automatically check if that player is online, its just running through the numbers.
Wooo! Thanks for the free "idiot".

The only idiot is you,who need to insult for exposing a discussion.

I dont use IsPlayerConnected doing my loops and all commands/functions works perfectly.

Learn to respect people,fanboy.
Reply
#11

That's what i said,you can use or not,depends on your choice.
Reply
#12

Small typo.
Reply
#13

Quote:
Originally Posted by Logitech90
View Post
That's what i said,you can use or not,depends on your choice.
Sigh.. You're very bright, I'm sure you'll be a top scripter in no time with that attitude.
Reply
#14

Quote:
Originally Posted by PrawkC
View Post
Sigh.. You're very bright, I'm sure you'll be a top scripter in no time with that attitude.
You can leave the sarcasm to you.

Don't act like you know all things about scripting,just because i made a small error doesn't matter.

I dont have to be a top scripter,i prefer to be a normal scripter.

Now please stfu and go away.You have insulted me with "idiot" phrase.

I dont judge people without knowing them.

But you do,so who's the idiot now?

Stop acting please.I hate who feels superior.
Reply
#15

Quote:
Originally Posted by Logitech90
View Post
You can leave the sarcasm to you.

Don't act like you know all things about scripting,just because i made a small error doesn't matter.

I dont have to be a top scripter,i prefer to be a normal scripter.

Now please stfu and go away.You have insulted me with "idiot" phrase.

I dont judge people without knowing them.

But you do,so who's the idiot now?

Stop acting please.I hate who feels superior.
Not the typo, I'm talking about the using of IsPlayerConnected being a "choice"

and I still think you're the idiot.
Reply
#16

Quote:
Originally Posted by PrawkC
View Post
Not the typo, I'm talking about the using of IsPlayerConnected being a "choice"

and I still think you're the idiot.
I dont care what you think.

When the insult comes from a person that his value is zero,the insult is nothing.

So if for you im the idiot,for me you are zero.

I can report you for insulting but i dont wanna lose time.I've better things to do.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)