Cookie
#1

hi I have created a command /cookie using dcmd and LuxAdmin function...

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;
}
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...

Code:
 if(playerid == IsPlayerLuxAdminLevel(playerid,0)) SendClientMessage(playerid, Red, "You are not authorized to use this command");
please help...
Reply
#2

Just use
pawn Code:
if(!IsPlayerLuxAdmin(playerid)) return SendClientMessage(playerid, Red, "You are not authorized to use this command");
Reply
#3

thank u...
Reply
#4

Quote:
Originally Posted by Cenation
View Post
thank u...
There's also another way to do it. That way will work, but I'm bringing the chances up.

pawn Code:
if(IsPlayerLuxAdminLevel(playerid,0)) return SendClientMessage(playerid, Red, "You are not authorized to use this command");
That would work too.
Reply
#5

thank u to u too...
Reply
#6

not working both plz....

Edited : its working now! thank u....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)