26.05.2012, 20:26
Quote:
This might help
PHP код:
|
pawn Код:
#include <a_samp>
#include <sscanf2>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOUR_SYSTEM 0xB60000FF
#define COLOUR_PM 0xFFFF2AFF
#define COLOUR_INFO 0x00983BFF
new togglepm[MAX_PLAYERS],ID,message[128],str[128],Nam[MAX_PLAYER_NAME],Pname[MAX_PLAYER_NAME];
public OnPlayerConnect(playerid)
{
togglepm[playerid] = 1;
return 1;
}
CMD:pm(playerid, params[])
{
if(sscanf(params,"us",ID,message)) return SendClientMessage(playerid,0xF6BB0AA,"USAGE: /pm [ID] [message]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,0xFF0000FF,"Invalid ID");
if(togglepm[ID] == 0) return SendClientMessage(playerid,0xFB0000AA,"ERROR: That user has his pm toggled off");
GetPlayerName(ID,Pname,sizeof(Pname));
GetPlayerName(playerid,Nam,sizeof(Nam));
format(str,sizeof(str),">> %s(%d): %s",Pname,playerid,message);
SendClientMessage(playerid,0xFFFF00FF,str);
format(str,sizeof(str),"** %s(%d): %s",Nam,playerid,message);
SendClientMessage(ID,0xFFFF00FF,str);
return 1;
}
CMD:togglepm(playerid,params[])
{
if(togglepm[playerid] == 1)
{
SendClientMessage(playerid,0xF6BB0AA,"You had toggled your pm OFF");
togglepm[playerid] = 0;
}
else if(togglepm[playerid] == 0)
{
SendClientMessage(playerid,0xF6BB0AA,"You had toggled your pm ON");
togglepm[playerid] = 1;
}
return 1;
}
C:\Documents and Settings\Nikos\ЕрйцЬнейб есгбуЯбт\samp server testing\filterscripts\nopm.pwn(29) : error 021: symbol already defined: "togglepm"
C:\Documents and Settings\Nikos\ЕрйцЬнейб есгбуЯбт\samp server testing\filterscripts\nopm.pwn(31) : error 010: invalid function or declaration
C:\Documents and Settings\Nikos\ЕрйцЬнейб есгбуЯбт\samp server testing\filterscripts\nopm.pwn(36) : error 010: invalid function or declaration
C:\Documents and Settings\Nikos\ЕрйцЬнейб есгбуЯбт\samp server testing\filterscripts\nopm.pwn(41) : error 010: invalid function or declaration
C:\Documents and Settings\Nikos\ЕрйцЬнейб есгбуЯбт\samp server testing\filterscripts\nopm.pwn(43) : warning 203: symbol is never used: "pm"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.