COMMAND:makeadmin(playerid, params[])
{
SendClientMessageToAll(WHITE, "Welcome an administrator to the team!");
//this bit here, how would I make it to set someone else to an admin?
//I have this for the level thing thing....
dini_IntSet(file, "Level", gPlayerInfo[playerid][PLAYER_LEVEL]);
//that is the admin level, how could I send it?
return 1;
}
COMMAND:makeadmin(playerid, params[])
{
new targetid;
if(sscanf(params, "u", targetid))
return SendClientMessage(playerid, COLOR_GREY, "USAGE: /makeadmin [playerid/name]");
if(!IsPlayerConnected(targetid)))
return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid name/id!");
//
SendClientMessageToAll(WHITE, "Welcome an administrator to the team!");
gPlayerInfo[targetid][PLAYER_LEVEL] = 1; //(this being the admin level number)
SendClientMessage(targetid, COLOR_WHITE, "Your now a server administrator");
return 1;
}
COMMAND:makeadmin(playerid, params[])
{
if(IsPlayerAdmin(playerid)) //Checks to see if the user is logged in to RCON
{
//use code from above or your own
pawn Код:
And just create a save function so when the player disconnects all the dini_IntSet's go under that save function and you'd just get the info from the gPlayerInfo variables. |
COMMAND:makeadmin(playerid, params[])
{
new targetid;
if(sscanf(params, "u", targetid))
return SendClientMessage(playerid, COLOR_GREY, "USAGE: /makeadmin [playerid/name]");
if(!IsPlayerConnected(targetid)))
return SendClientMessage(playerid, COLOR_RED, "Invalid name/id!");
//
SendClientMessageToAll(COLOR_WHITE, "Welcome an administrator to the team!");
gPlayerInfo[targetid][PLAYER_LEVEL] = 1; //(this being the admin level number)
SendClientMessage(targetid, COLOR_WHITE, "Your now a server administrator");
return 1;
}
C:\Users\Dad\Desktop\gamemodes\new.pwn(718) : error 029: invalid expression, assumed zero C:\Users\Dad\Desktop\gamemodes\new.pwn(718 -- 719) : warning 215: expression has no effect C:\Users\Dad\Desktop\gamemodes\new.pwn(719) : error 001: expected token: ";", but found "return" C:\Users\Dad\Desktop\gamemodes\new.pwn(721) : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
Alright thanks for the help y'all, appreciate it!, also, I will be testing it later, and Steven82 if you don't mind, could I pm you to let you know the result?
![]() |