Cookie - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Cookie (
/showthread.php?tid=291950)
Cookie -
Cenation - 22.10.2011
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...
Re: Cookie -
Ensconce - 22.10.2011
Just use
pawn Code:
if(!IsPlayerLuxAdmin(playerid)) return SendClientMessage(playerid, Red, "You are not authorized to use this command");
Re: Cookie -
Cenation - 22.10.2011
thank u...
Re: Cookie - Max_Coldheart - 22.10.2011
Quote:
Originally Posted by Cenation
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.
Re: Cookie -
Cenation - 22.10.2011
thank u to u too...
Re: Cookie -
Cenation - 22.10.2011
not working both plz....
Edited : its working now! thank u....