Privet Message bug - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Privet Message bug (
/showthread.php?tid=104500)
Privet Message bug -
tomnidi - 24.10.2009
The error:
warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
The code:
Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
new string[128];
if(PMsEnabled[recieverid])
{
format(string, sizeof(string), "[PM:] PM from %s(%d): %s", GetPlayerNameEx(playerid),playerid, text);
SendClientMessage(recieverid,COLOR_MEDIUMBLUE,string);
format(string, sizeof(string), "[OOCPM:] PM sent to %s(%d): %s", GetPlayerNameEx(recieverid),recieverid, text);
SendClientMessage(playerid,COLOR_MEDIUMBLUE,string);
format(string, sizeof(string), "[PM:] PM from %s(%d) to %s(%d): %s", GetPlayerNameEx(playerid),playerid, GetPlayerNameEx(recieverid),recieverid, text);
PMLog(string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pSeepm] == 1)
{
format(string, sizeof(string), "[PM:] PM from %s(%d) to %s(%d): %s", GetPlayerNameEx(playerid),playerid, GetPlayerNameEx(recieverid),recieverid, text);
SendClientMessage(i, COLOR_DBLUE, string);
}
}
}
return 1;
}
else
{
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[ERROR:] That user has disabled PM's.");
}
return 1;
}
What is the problem here guys?
Re: Privet Message bug -
(.Aztec); - 24.10.2009
It was removed in 0.3, just rename it if you're actually using it.
Re: Privet Message bug -
Dsg - 24.10.2009
does it work?
Re: Privet Message bug -
Tyler_Idy - 24.10.2009
up at the top do:
forward OnPlayerPrivmsg(playerid, recieverid, text[]);
Re: Privet Message bug -
tomnidi - 25.10.2009
Nothing works.. I think I just need a new /pm command..
Re: Privet Message bug -
Joe Staff - 25.10.2009
add forward OnPlayerPrivmsg(playerid, recieverid, text[]);
and under OnPlayerCommandText do
pawn Код:
if(!strcmp(cmdtext[1],"pm",true,2))
{
if(!cmdtext[3]||!cmdtext[4])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /pm [id] [text]");
new receiverid=strval(cmdtext[4]);
new begintext=strfind(cmdtext[4]," ")+1;
if(begintext<1)return SendClientMessage(playerid,0xFF0000FF,"USAGE: /pm [id] [text]");
if(!IsPlayerConnected(receiverid))return SendClientMessage(playerid,0xFF0000FF,"Invalid Playerid");
if(!strlen(cmdtext[begintext]))return SendClientMessage(playerid,0xFF0000FF,"USAGE: /pm [id] [text]");
OnPlayerPrivmsg(playerid,receiverid,cmdtext[begintext]);
return 1;
}