Command help (rep+)
#1

PHP код:
if(strcmp(cmd"/swimmingevent"true) == 0)
    {
        if(
IsPlayerConnected(playerid) && (swimmingevent == 0) && IsPlayerAdmin(playerid))
        {
            
swimmingevent 1;
            
BroadCast(COLOR_GREEN"   Swimming aviable(/joinswimmingevent)!");
        }
        else if(
IsPlayerConnected(playerid) && (swimmingevent == 1) && IsPlayerAdmin(playerid))
        {
            
swimmingevent 0;
            
BroadCast(COLOR_GREEN"   Swimming event disable.");
        }
        return 
1;
    } 
who can make me the commad with this
PHP код:
if(PlayerInfo[playerid][pAdmin] < 1337
because i don't wont only rcon admins to can use it


How i can make when an admin write /swimmingevent to show to all player anannouncement to join in the event with command (the command is /joinevent)
Reply
#2

pawn Код:
if(IsPlayerConnected(playerid) && (swimmingevent == 0) && (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin > 1337))
{
    //Rest of command
}
Reply
#3

nvm ^^
Reply
#4

what Admin system are you using?
Reply
#5

If you only want level 1337+ to be able to use the code, the following will work:

pawn Код:
if(strcmp(cmd, "/swimmingevent", true) == 0)
{
    if(IsPlayerConnected(playerid) && (swimmingevent == 0) && (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1337))
    {
        swimmingevent = 1;
        BroadCast(COLOR_GREEN, "   Swimming aviable (/joinswimmingevent)!");
    }
    else if(IsPlayerConnected(playerid) && (swimmingevent == 1) && (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1337))
    {
        swimmingevent = 0;
        BroadCast(COLOR_GREEN, "   Swimming event disable.");
    }
    return 1;
}
To permit lower levels, change the 1337 to the LOWEST admin level that you would like to grant access to
Reply
#6

Thank you Rob_Maate i give you rep but how i can make when an admin write /swimmingevent to show to all player anannouncement to join in the event with command (the command is /joinevent)
Reply
#7

I'm assuming that the BroadCast function would display a message to all connected players.
If it is buggy, replace those lines with:

pawn Код:
SendClientMessageToAll(COLOR_GREEN, "    The Swimming Event has begun! {FFFFFF}((/joinevent))"); //For the first
pawn Код:
SendClientMessageToAll(COLOR_GREEN, "    The Swimming Event has ended!"); //For the second
Reply
#8

Ehh, for an event is a simple "SendClientMessageToAll" a little simple and small, isn't it?


I would recommend that you use:

pawn Код:
GameTextForAll("~y~The Swimmingevent has begun!",1000,6);
for the last one then:

pawn Код:
GameTextForAll("~y~The Swimmingevent has ended!",1000,6);
Change the ~y~ to any color you want...
Reply
#9

Hell no...
If you just cluster the screen with bullshit people leave your server.
That's why it's best to keep the majority of information within the chatfeed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)