What's Wrong! /idiot [ID]
#1

pawn Код:
#include <a_samp>

#define FILTERSCRIPT
#define COLOR_RED 0xFF0000AA


CMD:idiot(playerid, params[])
{
    new
        otherid,
        oName[MAX_PLAYER_NAME],
        string[64]
    ;
    if (!IsPlayerAdmin(playerid)) return 0;
    if(sscanf(params, "u", otherid)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /Idiot [id]");

    GetPlayerName(playerid, oName, sizeof(oName));
    format(string, sizeof(string), "**(IDIOT)** %s <-- Is an idiot!", oName);
    SendClientMessageToAll(COLOR_RED, string);
    return 1;
}
Error:
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\Idiot.pwn(10) : warning 203: symbol is never used: "idiot"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Reply
#2

So... what is the problem?
Reply
#3

Quote:
Originally Posted by TheHoodRat
Посмотреть сообщение
So... what is the problem?
Look again
Reply
#4

under OnPlayerCommandText, after you create the command with, zcmd(I believe), you need to do:


zcmd(idiot, 5, cmdtext); or something along those lines, but it needs to be done before the return 0;
Reply
#5

Quote:
Originally Posted by Larsey123IsMe
Посмотреть сообщение
Look again
pawn Код:
#include <a_samp>
#include <zcmd>

#define FILTERSCRIPT
#define COLOR_RED 0xFF0000AA


CMD:idiot(playerid, params[])
{
    new
        otherid,
        oName[MAX_PLAYER_NAME],
        string[64]
    ;
    if (!IsPlayerAdmin(playerid)) return 0;
    if(sscanf(params, "u", otherid)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /Idiot [id]");

    GetPlayerName(playerid, oName, sizeof(oName));
    format(string, sizeof(string), "**(IDIOT)** %s <-- Is an idiot!", oName);
    SendClientMessageToAll(COLOR_RED, string);
    return 1;
}
You need to download zcmd.

Download here.

Before you can use the script above, you have to download zcmd then paste it in your pawno/includes folder, hope I helped.

Quote:
Originally Posted by Hiitch
Посмотреть сообщение
under OnPlayerCommandText, after you create the command with, zcmd(I believe), you need to do:


zcmd(idiot, 5, cmdtext); or something along those lines, but it needs to be done before the return 0;
No, that only works with dcmd.
Reply
#6

Quote:
Originally Posted by Hiitch
Посмотреть сообщение
under OnPlayerCommandText, after you create the command with, zcmd(I believe), you need to do:


zcmd(idiot, 5, cmdtext); or something along those lines, but it needs to be done before the return 0;
That's 'dcmd' what you talking about.
Reply
#7

Ah ok, looks like I learned something new then. Thanks.
Reply
#8

Quote:
Originally Posted by TheHoodRat
Посмотреть сообщение
pawn Код:
#include <a_samp>
#include <zcmd>

#define FILTERSCRIPT
#define COLOR_RED 0xFF0000AA


CMD:idiot(playerid, params[])
{
    new
        otherid,
        oName[MAX_PLAYER_NAME],
        string[64]
    ;
    if (!IsPlayerAdmin(playerid)) return 0;
    if(sscanf(params, "u", otherid)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /Idiot [id]");

    GetPlayerName(playerid, oName, sizeof(oName));
    format(string, sizeof(string), "**(IDIOT)** %s <-- Is an idiot!", oName);
    SendClientMessageToAll(COLOR_RED, string);
    return 1;
}
You need to download zcmd.

Download here.

Before you can use the script above, you have to download zcmd then paste it in your pawno/includes folder, hope I helped.



No, that only works with dcmd.
It acctually made it worse xD
Error:

pawn Код:
C:\Users\Lars Erik\Documents\SAMP Server\My server\filterscripts\FACEPALM (WIP)\FACEPALM.pwn(16) : error 017: undefined symbol "sscanf"
C:\Users\Lars Erik\Documents\SAMP Server\My server\filterscripts\FACEPALM (WIP)\FACEPALM.pwn(16) : error 017: undefined symbol "COLOR_GRAD2"
C:\Users\Lars Erik\Documents\SAMP Server\My server\filterscripts\FACEPALM (WIP)\FACEPALM.pwn(11) : warning 203: symbol is never used: "otherid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#9

Quote:
Originally Posted by Larsey123IsMe
Посмотреть сообщение
It acctually made it worse xD
Error:

pawn Код:
C:\Users\Lars Erik\Documents\SAMP Server\My server\filterscripts\FACEPALM (WIP)\FACEPALM.pwn(16) : error 017: undefined symbol "sscanf"
C:\Users\Lars Erik\Documents\SAMP Server\My server\filterscripts\FACEPALM (WIP)\FACEPALM.pwn(16) : error 017: undefined symbol "COLOR_GRAD2"
C:\Users\Lars Erik\Documents\SAMP Server\My server\filterscripts\FACEPALM (WIP)\FACEPALM.pwn(11) : warning 203: symbol is never used: "otherid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
hehe Change the color cause obviously you don't have COLOR_GRAD2 So Change it COLOR_RED Then Search for SSCANF And For otherid What the heck is that a copy and paste?
Reply
#10

Huh?

pawn Код:
#include <a_samp>
#include <sscanf2>

#define FILTERSCRIPT
#define COLOR_RED 0xFF0000AA
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1


dcmd_idiot(playerid, params[])
{
    new string[64], oName[MAX_PLAYER_NAME];
    GetPlayerName( playerid, oName, sizeof(oName) );
    if (!IsPlayerAdmin(playerid)) return 0;
    if (sscanf(params, "u", playerid))
    {
        return SendClientMessage(playerid, COLOR_RED, "USAGE: /Idiot [id]");
    }

    GetPlayerName(playerid, oName, sizeof(oName));
    format(string, sizeof(string), "**(IDIOT)** %s is an idiot", oName);
    SendClientMessageToAll(COLOR_RED, string);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/Idiot",cmdtext,true) == 0)
    {
    dcmd(idiot,5,cmdtext);
    return 1;
    }
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\Idiot.pwn(32) : error 030: compound statement not closed at the end of file (started at line 27)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)