Posts: 257
Threads: 48
Joined: Feb 2013
Reputation:
0
I need some help with making a CMD:makeadmin
command with zcmd,I am using y_ini and my setup for the enum is like this
pAdmin
pScore
pCash
pVipLevel
pOwner
etc
and its PlayerInfo not pInfo or what ever :P
I need someone to direct me to a tutorial that makes this command that only works with if your pAdmin level = #
I dont use rcon so I dont want it for if you login with it
Posts: 257
Threads: 48
Joined: Feb 2013
Reputation:
0
Thank you very much man,been trying to figure this out for a while XD I am fairly new at scripting,but I am making a pretty cool unique gamemode, ^_^ need this stuff,hey man,do you know if I can use a admin filterscript that uses dini,even though I use y_ini in my gm script?
Posts: 439
Threads: 62
Joined: Apr 2012
Quote:
Originally Posted by NinjahZ
I need someone to direct me to a tutorial that makes this command
|
Quote:
Originally Posted by Rafael_Zambrano
i guess that this will run
pawn Код:
COMMAND:setadmin(playerid, params[]) {
if(PlayerInfo[playerid][Adminlevel] <= 5) return SendClientMessage(playerid, -1, "AdmCmd: You don't have the privilege to use this command."); new string[1000],playerid,level; if(sscanf(params, "ui", playerid,level)) return SendClientMessage(playerid, -1, "Info: /Setadmin (Playerid) (Adminlevel)"); if(playerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Error: Wrong Playerid."); if(level >= 8 || level <= 0) return SendClientMessage(playerid,-1,"Error: Max admin level is ( 7 )."); format(string,sizeof(string),"AdmCmd: Administrator \"%s (%d)\" has set your admin level to ( Level: %d ).",GetName(playerid),playerid,level); SendClientMessage(playerid,-1,string); format(string,sizeof(string),"AdmCmd: You have set player \"%s (%d)\" admin level to ( Level: %d ).",GetName(playerid),playerid,level); SendClientMessage(playerid,-1,string); PlayerInfo[playerid][Adminlevel] = level; return 1; }
also you may define
pawn Код:
#define SCM SendClientMessage
thats if you don't want to write SendClientMessage
|
I know you're trying to help an' all, but he asked for a tutorial, not a command you've ripped out of a script. Binx was correct by adding comments to let the beginner know what was happening.