Command help (rep+) -
boyan96 - 11.02.2012
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)
Re: Command help (rep+) -
[XST]O_x - 11.02.2012
pawn Код:
if(IsPlayerConnected(playerid) && (swimmingevent == 0) && (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin > 1337))
{
//Rest of command
}
Re: Command help (rep+) -
Bogdan1992 - 11.02.2012
nvm ^^
Re: Command help (rep+) -
mhamadsaleh - 11.02.2012
what Admin system are you using?
Re: Command help (rep+) -
Rob_Maate - 11.02.2012
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
Re: Command help (rep+) -
boyan96 - 13.02.2012
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)
Re: Command help (rep+) -
Rob_Maate - 13.02.2012
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
Re: Command help (rep+) -
Twisted_Insane - 13.02.2012
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...
Re: Command help (rep+) -
Rob_Maate - 13.02.2012
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.