sscanf /radio - 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: sscanf /radio (
/showthread.php?tid=193059)
sscanf /radio -
corne - 24.11.2010
Im busy with my 28 days later gamemode and my radio command gives this error:
Код:
C:\Documents and Settings\Corne\Bureaublad\Vandex Servers\server4\gamemodes\28dl.pwn(189) : error 017: undefined symbol "sscanf"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
This is the command:
Код:
dcmd_radio(playerid, params[])
{
new rtext[240], rand1, rand2;
if (sscanf(params, "z", rtext))
{
return SendClientMessage(playerid, COLOR_WHITE, " USAGE: /radio <text>");
}
GetPlayerName(playerid, pName, sizeof(pName));
rand1 = random(10+0);
rand2 = random(10+0);
if(PlayerInfo[playerid][pInfected] == 0 && PlayerInfo[playerid][pRadio] == 1)
{
if(rand1 < 4 && rand2 > 6)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pInfected] == 0)
{
format(nstring, sizeof(nstring), "[RADIO] %s: %s", pName, rtext);
SendClientMessage(i, COLOR_YELLOW, nstring);
}
}
} else {
SendClientMessage(playerid, COLOR_YELLOW, "You`re radio didnt found connection");
}
} else {
SendClientMessage(playerid, COLOR_YELLOW, "You are infected or You dont have a radio!");
}
return 1;
}
I have sscanf. I do not see the problem why i get that error.
Anyone see why?
Re: sscanf /radio -
Zh3r0 - 24.11.2010
Lol at his code!
pawn Код:
rand1 = random(10+0);
rand2 = random(10+0);
By the way, you get that because you don't have sscanf :-O
Re: sscanf /radio -
Ash. - 24.11.2010
Why dont you just use the dcmd 'params' string? - and get rid of sscanf from that script? - Something like this:
pawn Код:
dcmd_radio(playerid, params[])
{
new rtext[240], rand1, rand2;
if (strlen(params) == 0)
{
return SendClientMessage(playerid, COLOR_WHITE, " USAGE: /radio <text>");
}
else
{
rtext = params;
}
GetPlayerName(playerid, pName, sizeof(pName));
rand1 = random(10+0);
rand2 = random(10+0);
if(PlayerInfo[playerid][pInfected] == 0 && PlayerInfo[playerid][pRadio] == 1)
{
if(rand1 < 4 && rand2 > 6)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pInfected] == 0)
{
format(nstring, sizeof(nstring), "[RADIO] %s: %s", pName, rtext);
SendClientMessage(i, COLOR_YELLOW, nstring);
}
}
} else {
SendClientMessage(playerid, COLOR_YELLOW, "You`re radio didnt found connection");
}
} else {
SendClientMessage(playerid, COLOR_YELLOW, "You are infected or You dont have a radio!");
}
return 1;
}
Re: sscanf /radio -
willsuckformoney - 24.11.2010
lol
pawn Код:
if(!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, " USAGE: /radio <text>");
Re: sscanf /radio -
corne - 24.11.2010
Fixed, Thanks