Larsey123IsMe
Unregistered
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.
Posts: 180
Threads: 20
Joined: May 2010
Reputation:
0
So... what is the problem?
Larsey123IsMe
Unregistered
Quote:
Originally Posted by TheHoodRat
So... what is the problem?
|
Look again
Posts: 370
Threads: 21
Joined: Jun 2009
Reputation:
0
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;
Posts: 370
Threads: 21
Joined: Jun 2009
Reputation:
0
Ah ok, looks like I learned something new then. Thanks.
Larsey123IsMe
Unregistered
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.
Larsey123IsMe
Unregistered
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.