Command Help.
#1

pawn Код:
//Hai



#include <a_samp>

#define COLOR_YELLOW         0xFFFF00AA
#define FILTERSCRIPT
#include sscanf2
#include zcmd
#define RED 0xFF0000AA

CMD:report(playerid, params[])
{
    new aName[MAX_PLAYER_NAME], str[128], reason, iD;
    if (sscanf(params, "dz", iD, reason)) return SCM(playerid, RED, "* Usage : /report [PlayerID/Name] [Reason]");
    if (iD == INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "ERROR : Invaild PlayerID");
    if (playerid == iD) return SendClientMessage(playerid, RED, "ERROR : You cannot report yourself");
    GetPlayerName(iD, aName, sizeof(aName));
    format(str, sizeof(str), "%s(%d) has reported %s(%d) for : %s", pName(playerid), playerid, aName, iD, reason);
    SendClientMessageToAdmins(COLOR_YELLOW, str); //change this to yours!
    return true;
}
stock SendClientMessageToAdmins(color, text[])
{
    for(new a, g = GetMaxPlayers(); a < g; a++)
        if(IsPlayerConnected(a) && IsPlayerAdmin(a))
            SendClientMessage(a, color, text);
}
Reply
#2

1. You already started a thread. https://sampforum.blast.hk/showthread.php?tid=256418
2. Where/what's the problem?
Reply
#3

#include zcmd =

pawn Код:
C:\Users\Alex\Desktop\HydraBlast\filterscripts\Report.pwn(15) : error 017: undefined symbol "SCM"
C:\Users\Alex\Desktop\HydraBlast\filterscripts\Report.pwn(16) : error 017: undefined symbol "RED"
C:\Users\Alex\Desktop\HydraBlast\filterscripts\Report.pwn(17) : error 017: undefined symbol "RED"
C:\Users\Alex\Desktop\HydraBlast\filterscripts\Report.pwn(19) : error 017: undefined symbol "pName"
C:\Users\Alex\Desktop\HydraBlast\filterscripts\Report.pwn(20) : error 017: undefined symbol "SendAdminMessage"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Reply
#4

Sorry, I don't use zcmd. I use dcmd So I don't know the problem.
Reply
#5

I made the whole FS for you

Should work not tested
pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <sscanf2>

COMMAND:report(playerid, params[])
{
    new targetid, reason[128];
    if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, 0xFFFFFFAA, "SYNTAX Error: /report (targetid | name) (reason)");
    else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFAA, "Error: That player is not connected");
    else if(playerid == targetid)  return SendClientMessage(playerid, 0xFFFFFFAA, "Error: You cannot report your self");
    {
        new string[128];
        format(string, sizeof(string), "%s(%d) has reported %s(%d) for: %s", PlayerName(playerid), playerid, PlayerName(targetid), targetid, reason);
        SendClientMessageToAdmins(0xFFFFFFAA, string);
    }
    return 1;
}

stock SendClientMessageToAdmins(color, const message[])
{
    for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
    {
        SendClientMessageToAll(color, message);
    }
}

stock PlayerName(playerid)
{
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}
Reply
#6

While in-game its unknown command. =/
Reply
#7

Bump.
Reply
#8

lol dude u r a stealer no one gonna help you stealer
Reply
#9

?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)