help adminpm
#1

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;
}
Reply
#2

if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "Admin Only !");
Reply
#3

PHP код:
can i see your enum?
example 
enum PInfo
{

Reply
#4

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;
}
Reply
#5

Код:
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 !");
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)