22.10.2011, 06:15
hi I have created a command /cookie using dcmd and LuxAdmin function...
In this line listed below, i have created admin level (LuxAdmin) but it is not working, when normal player type /cookie [id] [amount] it works for them...
please help...
Code:
dcmd_cookie(playerid, params[]) { if(playerid == IsPlayerLuxAdminLevel(playerid,0)) SendClientMessage(playerid, Red, "You are not authorized to use this command"); else if(sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, Orange, "USAGE : /cookie [playerid] [amount]"); else if(giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, Red, "ERROR : That player is not connected!"); else { new string[156],file[100],Name[MAX_PLAYER_NAME],Ip[16],name[MAX_PLAYER_NAME]; GetPlayerName(giveplayerid, name, sizeof(name));GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name); format(string, sizeof(string), "You have succesfully sent %d cookies to %s!", amount, name); SendClientMessage(playerid, Limegreen, string); format(string, sizeof(string), "Admin %s has given you %d cookies!", Name, amount); SendClientMessage(giveplayerid, Limegreen, string); pInfo[giveplayerid][Cookies] += amount; dini_IntSet(file,"Cookies", pInfo[giveplayerid][Cookies]); dini_IntSet(file,"Cookies", pInfo[playerid][Cookies]); } return 1; }
Code:
if(playerid == IsPlayerLuxAdminLevel(playerid,0)) SendClientMessage(playerid, Red, "You are not authorized to use this command");