help adminpm - 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: help adminpm (
/showthread.php?tid=515973)
help adminpm -
kurniarocki - 29.05.2014
i am was admin 99999 but why this cmd cannot used "Admin Only"
pawn Код:
CMD:adminpm(playerid, params[])
{
new Str[128];
new PID, reason[128];
if(sscanf(params, "us[45]", PID, reason)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /adminpm [PlayerID] [Message]");
if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid, COLOR_GREY, "Admin Only !");
if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_GREY, "That user is not connected!");
{
format(Str, sizeof(Str), "(( PM From: Admin: %s ))", reason);
SendClientMessage(PID, COLOR_RED, Str);
format(Str, sizeof(Str), "(( PM Sent To: %s(%d): %s ))", pName(PID), PID, reason);
SendClientMessage(playerid, COLOR_LIGHTRED, Str);
}
return 1;
}
Re: help adminpm -
Scrillex - 29.05.2014
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "Admin Only !");
Re: help adminpm -
Stealthshooter - 29.05.2014
PHP код:
can i see your enum?
example
enum PInfo
{
}
Re: help adminpm -
Threshold - 29.05.2014
pawn Код:
CMD:adminpm(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "Admin Only !");
new PID, message[75];
if(sscanf(params, "us[75]", PID, message)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /adminpm [PlayerID] [Message]");
if(!IsPlayerConnected(PID) || PID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "That user is not connected!");
new Str[128];
format(Str, sizeof(Str), "(( PM From: Admin: %s ))", message);
SendClientMessage(PID, COLOR_RED, Str);
format(Str, sizeof(Str), "(( PM Sent To: %s(%d): %s ))", pName(PID), PID, message);
SendClientMessage(playerid, COLOR_LIGHTRED, Str);
return 1;
}
Re: help adminpm -
TazmaNiax - 29.05.2014
Код:
if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid, COLOR_GREY, "Admin Only !");
Should be like this
Код:
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "Admin Only !");
Re: help adminpm -
Stinged - 29.05.2014
The one everyone posted is right, but if you read this it will be more helpful than just copying and pasting.
https://sampwiki.blast.hk/wiki/Control_Structures#Operators