How to make different levels
#10

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
its like you store level ( PlayerData[playerid][level] , you make a new variable for admin ( [playerid][admin], and at the admins commands check if his [admin] level is big enough.
Exactly what this guy said above, you need to store the player enumerator.

PHP код:
enum AdminLevel
{
   
Level
}
new 
PlayerInfo[MAX_PLAYERS][AdminLevel]; 
So once we did a enum for the player, it's now going to be like PlayerInfo[playerid][Level], now let's come to the commands (i will use ZCMD because it's faster, simple and pretty much viable compared to strcmp).

PHP код:
CMD:sethp(playeridparams[])
{
   if(
PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid, -1"{C3C3C3}(INFO) You don't have the priviliges to use this command.");
   {
     new 
amountstr[128], target;
     if(
sscanf(params"ui"targetamount)) return SendClientMessage(playerid, -1"{c3c3c3}(INFO) /sethp [id] [amount]");
     
format(strsizeof(str), "{EFB509}(INFO) An admin has set your health to %d"amount);
     
SendClientMessage(target, -1str);
     
SetPlayerHealth(targetamount);
   return 
1;

That's a simple Admin Command, with this
PHP код:
 if(PlayerInfo[playerid][Level] < 1
you check if the player has enough admin level to run the command.

PS: you should just starting learning about player enumerations, you are like stuck on a simple code
Reply


Messages In This Thread
How to make different levels - by Jithu - 23.02.2018, 09:01
Re: How to make different levels - by dexi - 23.02.2018, 09:04
Re: How to make different levels - by Jithu - 23.02.2018, 09:06
Re: How to make different levels - by PepsiCola23 - 23.02.2018, 09:09
Re: How to make different levels - by dexi - 23.02.2018, 09:11
Re: How to make different levels - by Jithu - 23.02.2018, 09:12
Re: How to make different levels - by Jithu - 23.02.2018, 09:18
Re: How to make different levels - by dexi - 23.02.2018, 09:21
Re: How to make different levels - by PepsiCola23 - 23.02.2018, 09:40
Re: How to make different levels - by wallen - 23.02.2018, 14:27

Forum Jump:


Users browsing this thread: 2 Guest(s)