Annoying...
#1

Код:
if(IsPlayerAdmin(playerid) == 1) || gteam[playerid]==Team_LSPD || gteam[playerid]==Team_DMV) {
error 029: invalid expression, assumed zero x2

Код:
warning 225: unreachable code
That's the next command, so I thought It was too many brackets or something, but No, If I remove one, I get thousands of errors.
If I add one, Pawn Compiler crashes.

Код:
if(IsPlayerAdmin(playerid) == 1 || gteam[playerid]==Team_DMV || gteam[playerid]==Team_LSPD) {
:S

What's the problem with this code? I mean, It works on other commands but not right here.
And the funny thing is that I didn't change it at all, I was doing other things under another Public function...

Note: I don't wanna post the code, because It's too unique.
Reply
#2

I could help you, but I cant see a part of code with my phone. can you pastebin.com it, please?
Reply
#3

The only problem i can see is

if(IsPlayerAdmin(playerid) == 1) is the wrong way to do it

if(IsPlayerAdmin(playerid)) is the way to do it

And when to check if he isnt admin add a ! infront like this

if(!IsPlayerAdmin(playerid))
Reply
#4

Quote:
Originally Posted by Desert
The only problem i can see is

if(IsPlayerAdmin(playerid) == 1) is the wrong way to do it

And when to check if he isnt admin add a ! infront like this

if(!IsPlayerAdmin(playerid))
I know, but It's working on the Admin commands, so It can't be the wrong way to do it....

Edit: Maybe not :S
Reply
#5

Those script who does that is "Admins" that is homemade/downloaded admin scripts which when they login their admin lvl gets set to 1 etc.
In fact its just like when your making jobs. Their "faction job" gets set to 1

But this is RCON admin which is done the way as i said
Reply
#6

I tried your way of doing it, still gives the same error.
also;

for(new i = 0; i < MAX_PLAYERS; i++)
Код:
if (IsPlayerAdmin(i) || gteam[i]==Team_Admin || gteam[i]==Team_LSPD || gteam[i]==Team_DMV ) {
As I did the admin commands, (but now I added LSPD & DMV though), doesn't work neither.
Reply
#7

If you want to make an admin script, either 1: make an enum that includes the admin part of it

i.e.

pawn Код:
enum pInfo {
   Admin,
   Money,
   Score
};
new pData[MAX_PLAYERS][pInfo]

(Not sure how those work, but i've seen them alot)

or, you can make 3 stocks.

I have the stocks, but im unsure where they are at the moment, if I had them I would give you them.

but one things for sure, IsPlayerAdmin checks if the person is logged into rcon and must be used like

pawn Код:
IsPlayerAdmin(playerid)
or, to check if the player isnt rcon admin

pawn Код:
!IsPlayerAdmin(playerid) // exclamination mark to say if he isnt an admin
Hope that helped.
Reply
#8

LOL I KNOW all that!

I'm not making an Admin-script.
It's a license check command, that checks if the license is valid or not.

And all commands I'm doing will be able for RCON-Administrators, that's why I'm including that.
Reply
#9

Ok, well if you know all that, then take out the == 1 from the IsPlayerAdmin and it should work.
Reply
#10

I did! It still doesn't work -_-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)