please 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: please help (
/showthread.php?tid=513359)
please help -
rumen98 - 15.05.2014
PHP код:
COMMAND:radio(playerid,params[])
{
new text[256];
if(sscanf(params,"s",text)) return SendClientMessage(playerid,COLOR_RED,"Usage: /radio [Text]");
else
{
new textmessage[256];
format(textmessage, sizeof(textmessage), "%s",text);
SendRadioMessage(playerid,textmessage);
}
return 1;
}
PHP код:
stock SendRadioMessage(playerid,message)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(RLTnfo[i][Radio] == 1)
{
if(RLTnfo[i][RadioHZ] == RLTnfo[playerid][RadioHZ])
{
new sendmessage[256];
format(sendmessage, sizeof(sendmessage), "[Radio Message] %s",message);
SendClientMessage(i,COLOR_RED,sendmessage);
}
}
}
return 1;
}
PHP код:
D:\Downloads\ZombieWorld\filterscripts\reality.pwn(378) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
Line 378:
PHP код:
SendRadioMessage(playerid,textmessage);
I know that the problem is anywhere from, Stock and playerid but I can not fix it, please help
Re: please help -
DavidBilla - 15.05.2014
Quote:
Originally Posted by rumen98
PHP код:
Stock SendRadioMessage(playerid,textmessage)
|
Here
Re: please help -
rumen98 - 15.05.2014
when i remove playerid from Stock i got this errors
PHP код:
D:\Downloads\ZombieWorld\pawno\include\SRB.inc(154) : error 017: undefined symbol "playerid"
D:\Downloads\ZombieWorld\filterscripts\reality.pwn(396) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
Edit:
does not matter did it like that, without Stock
PHP код:
COMMAND:radio(playerid,params[])
{
new text[256];
if(sscanf(params,"s",text)) return SendClientMessage(playerid,COLOR_RED,"Usage: /radio [Text]");
else
{
new textmessage[256];
format(textmessage, sizeof(textmessage), "{FF0000}[Radio]{ADD8E6}%s",text);
for(new loopplayers = 0; loopplayers<MAX_PLAYERS; loopplayers ++)
{
if(IsPlayerConnected(loopplayers))
{
if(RLTnfo[loopplayers][Radio] == 1)
{
if(RLTnfo[loopplayers][RadioHZ] == RLTnfo[playerid][RadioHZ])
{
SendClientMessage(loopplayers,COLOR_LIGHTBLUE,textmessage);
}
}
}
}
}
return 1;
}
Re: please help -
DavidBilla - 15.05.2014
Dude you mismatched argument 2 in stock and radiomessage function
Just replace the stock line with the one i provided in previous reply. Dont remove playerid.
Re: please help -
RenSoprano - 15.05.2014
pawn Код:
stock SendRadioMessage(playerid, message[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(RLTnfo[i][Radio] == 1)
{
if(RLTnfo[i][RadioHZ] == RLTnfo[playerid][RadioHZ])
{
format(message, sizeof(message), "[Radio Message] %s",message);
SendClientMessage(i, COLOR_RED, message);
}
}
}
}