16.11.2010, 11:59
Oh come on ! No1 can help me ?! I tried this too... This is my command now :
I go ingame, everything's normal, but when I type in /makeadmin, nothing happends !
Quote:
public OnPlayerCommandText(playerid, cmdtext[]) { new sendername[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new cmd[256]; new string[128]; new tmp[256]; new idx; if(strcmp(cmd, "/makeadmin", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Crvena, "KORISTENJE: /makeadmin [playerid/DioImena] [level(1-3)]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if (PlayerInfo[playerid][AdminLvl] >= 1337 || IsPlayerAdmin(playerid)) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][AdminLvl] = level; format(string, sizeof(string), "Postavljen si za admina level %d od %s", level, sendername); SendClientMessage(para1, Crvena, string); format(string, sizeof(string), "Postavio si %s na admin level %d.", giveplayer,level); SendClientMessage(playerid, Crvena, string); } } } else { SendClientMessage(playerid, Crvena, "[ERROR]: Samo administratori mogu koristiti ovu komandu."); } } return 1; } return 0; } |