Hallo!
Ich habe mir mal einen fertigen Script zum Testen runtergeladen.
Bei diesem Script kann der RCON-Admin mit /setlevel einem User ein bestimmtes Level geben.
Hier der Code dazu:
if(strcmp(cmd, "/setlevel", true) == 0)
{
if(PlayerInfo[playerid][Level] >= 5) {
new tmp[256], player1, level;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, red, "USAGE: /setlevel [playerid] [level]");
player1 = strval(tmp);
if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID) return SendClientMessage(playerid,red,"ERROR: Player is not connected");
if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid,red,"ERROR: Player must be registered to be an admin");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /setlevel [playerid] [level]");
level = strval(tmp);
if(level > ServerInfo[MaxAdminLevel] ) return SendClientMessage(playerid,red,"ERROR: Incorrect Level");
tmp = strtok(cmdtext, idx);
CMDMessageToAdmins(playerid,"SETLEVEL");
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
new year,month,day; getdate(year, month, day);
if(level==1) { format(string,256,"Administrator %s has set you to Member Status [ level %d ]",adminname,level); SendClientMessage(player1,blue,string);
} else { format(string,256,"Administrator %s has set you to Administrator Status [ level %d ]",adminname,level); SendClientMessage(player1,blue,string); }
format(string,256,"You have made %s [Level %d] on %d/%d/%d", playername, level, day, month, year); SendClientMessage(playerid,blue,string);
format(string,256,"Administrator %s has made %s [Level %d] on %d/%d/%d",adminname, playername, level, day, month, year); SaveToFile("AdminLog",string);
dUserSetINT(PlayerName2(player1)).("level",(level));
PlayerInfo[player1][Level] = level;
} else {
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); }
return 1; }
Beim Complimieren wird jedoch kein Error und/oder Warning ausgegeben.
Wisst ihr vielleicht, wodran es liegt, dass beim Eingeben dieses Befehles der Server crashed?
Mit freundlichen Grüßen, Luc