Help please enter and help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help please enter and help (
/showthread.php?tid=320136)
Help please enter and help -
Aloushi - 21.02.2012
Код:
public OnPlayerPrivmsg(playerid, recieverid, text[]){
if(!IsPlayerConnected(playerid)||!IsPlayerConnected(recieverid)) return 1;
new string[256], ToName[24], Name[24]; GetPlayerName(playerid,Name,24);
if(Config[ExposePMS]) {
GetPlayerName(recieverid,ToName,24);
format(string,256,"PM: %s [%d] -> %s [%d]: %s",Name,playerid,ToName,recieverid,text);
SendMessageToAdmins(string);
}
if(Config[WireWithPM] && Variables[playerid][Wired]) {
Variables[playerid][WiredWarnings]--;
if(Variables[playerid][WiredWarnings]) {
format(string,256,"You have been wired thus preventing you from talking and PMing. [Warnings: %d/%d]",Variables[playerid][WiredWarnings],Config[WiredWarnings]);
SendClientMessage(playerid,white,string); return 0;
}
else {
format(string,256,"%s has been kicked from the server. [REASON: Wired]",Name);
SendClientMessageToAll(yellow,string); SetUserInt(playerid,"Wired",0);
Kick(playerid); return 0;
}
}
return 1;
}
the warning is
Код:
C:\Users\Abed\Desktop\filterscripts\XtremeAdmin2.pwn(1217) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Header size: 2596 bytes
Code size: 157636 bytes
Data size: 209000 bytes
Stack/heap size: 16384 bytes; estimated max. usage=5316 cells (21264 bytes)
Total requirements: 385616 bytes
1 Warning.
Re: Help please enter and help -
Vince - 21.02.2012
OnPlayerPrivmsg was a callback in SA-MP 0.2X but it was removed in 0.3. You'll have to forward the callback and reference it from your /pm command. Something like:
pawn Код:
CMD:pm(playerid, params[])
{
new receiver, pmtext[128];
sscanf(params, "rs[128]", receiver, pmtext);
CallLocalFunction("OnPlayerPrivmsg", "iis", playerid, receiver, pmtext);
return 1;
}
Also, your script is using too much resources, which causes that code size thing to display.