IsPlayerAdmin
#1

Hey there, one more question...

i have on my server so that people can choose their player colors.... here is one example of one;

Код:
}
if(listitem==4)
{
SetPlayerColor(playerid,COLOR_WHITE);
SendClientMessage(playerid,COLOR_WHITE,"This is your new colour.");
i was wondering how to make it so that i can have admin colors.... this is what i have so far..


Код:
}
if(listitem==5)
{
if(!IsPlayerAdmin(playerid))
SetPlayerColor(playerid,COLOR_KHAKI);
SendClientMessage(playerid,COLOR_WHITE,"This is your new Admin Color.");
{
else
}
SendClientMessage(playerid,COLOR_ORANGE,"You Are Not An Admin!");
can you please help me?


when i compile it i get this error

Код:
C:\Users\owner\Desktop\my samp server\my samp server - Copy\gamemodes\stunt.pwn(4286) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
thanks!
Reply
#2

i thought like this:
pawn Код:
}
if(listitem == 5)
{
if(IsPlayerAdmin(playerid)) {//checks if player is Admin
SetPlayerColor(playerid,COLOR_KHAKI);
SendClientMessage(playerid,COLOR_WHITE,"This is your new Admin Color.");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_ORANGE,"You Are Not An Admin!");
return 1;
}
Reply
#3

your right. thank you!
Reply
#4

i just tested this in game and this is what it does;

it sends the client a message like 6x saying "You are not an admin" (i am using XTremeAdmin2 and am a admin lvl 10)

then it sets the players color to that color anyways!


please help.
Reply
#5

Quote:
Originally Posted by Kevin_Joshen
Посмотреть сообщение
i just tested this in game and this is what it does;

it sends the client a message like 6x saying "You are not an admin" (i am using XTremeAdmin2 and am a admin lvl 10)

then it sets the players color to that color anyways!


please help.
pawn Код:
IsPlayerAdmin
FOR THIS you need to login as RCON
Reply
#6

so how do i make it so that normal non admin players can not change their color to that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)