SA-MP Forums Archive
Tiny little help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Tiny little help (/showthread.php?tid=274093)



Tiny little help - Prometheus - 04.08.2011

Hi fellas, I want all admins to have the same name colour when they are online (blue)

if(!IsPlayerLuxAdminLevel(playerid, 1))
{
SetPlayerColor(playerid,blue);
}

Its not working. I have this under OnPlayerConnect

What am I missing?

Thanks!


Re: Tiny little help - MadeMan - 04.08.2011

Do you have any other SetPlayerColor in your script?


Re: Tiny little help - Prometheus - 04.08.2011

Just this under onplayerconnect


SetPlayerColor(playerid, PlayerColors[playerid]);


Re: Tiny little help - MadeMan - 04.08.2011

You have to set admins color after they log in and get their admin status. Nobody is admin in OnPlayerConnect.


Re: Tiny little help - Prometheus - 04.08.2011

So under onplayerspawn?

EDIT

nope thats not it, I get the same error 010 on this line

if(!IsPlayerLuxAdminLevel(playerid, 1))


Re: Tiny little help - MadeMan - 04.08.2011

Quote:
Originally Posted by Prometheus
Посмотреть сообщение
So under onplayerspawn?
Yes, might work.


Re: Tiny little help - Prometheus - 04.08.2011

Read above


Re: Tiny little help - MadeMan - 04.08.2011

You're getting an error? Show the whole code.


Re: Tiny little help - Prometheus - 04.08.2011

pawn Код:
if(!IsPlayerLuxAdminLevel(playerid,1))
{
SetPlayerColor(playerid, BLUE);
}
pawn Код:
error 010: invalid function or declaration
pawn Код:
if(!IsPlayerLuxAdminLevel(playerid,1))



Re: Tiny little help - MadeMan - 04.08.2011

It's inside OnPlayerSpawn?


Re: Tiny little help - Prometheus - 04.08.2011

Yup.

I'll be damned, it works now

pawn Код:
public OnPlayerSpawn(playerid)
{
    PlayerPlaySound(playerid, 1184, -1370.2362,-256.3250,15.0000);
    SetPlayerHealth(playerid, 100);
    SetPlayerPos(playerid,-543.7243,2592.7314,53.5156);
    IsInDM[playerid] = 0;
    nojump2[playerid] = 0;
    ResetPlayerWeapons(playerid);
    if(!IsPlayerLuxAdminLevel(playerid,1))
    {
    SetPlayerColor(playerid, COLOR_RED);
    }
    TextDrawShowForPlayer(playerid, Textdraw1);
    SetPlayerWeather(playerid,1);
    SetPlayerVirtualWorld(playerid,0);
    return 1;
}



Re: Tiny little help - MadeMan - 04.08.2011

Show more code.


Re: Tiny little help - Prometheus - 04.08.2011

No...damn it!

Still just random colour!


Re: Tiny little help - MadeMan - 04.08.2011

Remove the '!'

pawn Код:
if(IsPlayerLuxAdminLevel(playerid,1))



Re: Tiny little help - Prometheus - 04.08.2011

I'll be damned, it works! Thank you very much!


Re: Tiny little help - Prometheus - 04.08.2011

Ahh damn there was one more thing!
Now, every admin is blue, all well and good

But lets say I want to have different colour for admin level 10? Is that possible, or will it mess everything up?

Or can I just copy but change level to 10 instead of 1?


Re: Tiny little help - MadeMan - 04.08.2011

pawn Код:
if(IsPlayerLuxAdminLevel(playerid,10))
    {
        SetPlayerColor(playerid, COLOR_RED); // level 10 admins color
    }
    else if(IsPlayerLuxAdminLevel(playerid,1))
    {
        SetPlayerColor(playerid, COLOR_RED); // other admins color
    }



Re: Tiny little help - Prometheus - 04.08.2011

Ahh yes of course! Im getting so rusty. Thank you again!!


Re: Tiny little help - LZLo - 04.08.2011

don't loose:
Quote:

#include <ladmin>

do you want to set the color of the players who are not administrators?