Posts: 528
Threads: 75
Joined: Jul 2011
Reputation:
0
Hey everybody!
I got a problem:
When I log myself in, I want to get admin-rights! Like that I am an admin, and that I got commands for admin, but only for admins!
I want /kick [playerid] [reason]
/god (I have infinite health, and I want that I can turn it off!) /god off
/teleport [playerid] (player gets teleport to ME)
Can I do this commands without YSI?
Max_Coldheart
Unregistered
Quote:
Originally Posted by Someone
SetPlayerHealth(playerid, 10000000);
|
This is not a good way to do it.
Better do it like:
pawn Код:
#define INFINITY 10000000 //This goes to top of script
CMD:god(playerid, params[]) //Defining the command name (requires ZCMD)
{
if(IsPlayerAdmin(playerid)) //Checking if player is RCON admin
{
SetPlayerHealth(playerid, INFINITY); //Setting health to defined amount
SetPlayerArmour(playerid, INFINITY); //Setting armour to defined amount
}
else //If he is NOT RCON admin
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!"); //Sends a message to the player
}
return 1; //Tells the compiler that it compiled successfully
}
Posts: 528
Threads: 75
Joined: Jul 2011
Reputation:
0
Thank u both! Yo Kush, I did everything of ur tut!
But u didn't understand:
I want those admin-rights when I join my server!
Double-O-Seven
Unregistered
Quote:
Originally Posted by Max_Coldheart
This is not a good way to do it.
Better do it like:
pawn Код:
#define INFINITY 10000000
CMD:god(playerid, params[]) { if(IsPlayerAdmin(playerid)) { SetPlayerHealth(playerid, INFINITY); SetPlayerArmour(playerid, INFINITY); } else { SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!"); } return 1; }
|
This does not matter at all if you are using it only there, also the actual value doesn't matter, it just must be high...
no need to define a makro for this...
Max_Coldheart
Unregistered
Quote:
Originally Posted by Double-O-Seven
This does not matter at all if you are using it only there, also the actual value doesn't matter, it just must be high...
no need to define a makro for this...
|
But for future usages of the infinity, it is better to be defined
Quote:
Originally Posted by SA:MP
1. This forum requires that you wait 120 seconds between posts. Please try again in 70 seconds.
|
Max_Coldheart
Unregistered
Quote:
Originally Posted by Kush
Whats the difference between yours and mines? You simply replaced my values in which what you've defined. They both work. Your method though is an example of loading a callback, within a callback. Which is totally useless.
And Samety, if your having trouble with the system PM me your Teamviewer information, I'd be more than willing to help.
Right on Double-O!
|
My style is better to be used if you are using infinity in more places than just one.
Posts: 528
Threads: 75
Joined: Jul 2011
Reputation:
0
Ehh Kush, the only thing I want is that the server know that I am an admin when I join the server!
Posts: 528
Threads: 75
Joined: Jul 2011
Reputation:
0
So from where should the server know, that when I type /makemeadmin that it's me?
It could be every player who types this!
@Markx
What's wrong with Kush's god command?