Sscanf problem - 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 problem (
/showthread.php?tid=87445)
Sscanf problem -
Pawno_Master - 20.07.2009
Hello,
I am new at sscanf and i'm am busy with the tutorial of it on wikipedia
but i made one sscanf command this is the command
Код:
{
dcmd(heal, 4, cmdtext);
return 0;
}
dcmd_heal(playerid, params[])
{
new
id;
if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
else
{
SetPlayerHealth(id, 100.0);
SendClientMessage(id, 0x00FF00AA, "You have been healed");
SendClientMessage(playerid, 0x00FF00AA, "Player healed");
}
return 1;
}
but i get undefined symbol errors and everything
Код:
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1596) : error 017: undefined symbol "dcmd_heal"
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1600) : warning 225: unreachable code
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1600) : error 017: undefined symbol "dcmd_heal"
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1604) : error 017: undefined symbol "params"
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1614) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
help plz
if i learned this i can make alot of new things
Re: Sscanf problem -
MadeMan - 20.07.2009
1. Do you have dcmd #define on top of your script?
2. Are you sure that dcmd_heal(playerid, params[]) is OUTSIDE of OnPlayerCommandText ?
Re: Sscanf problem -
Pawno_Master - 20.07.2009
I have the define line above on my script under the includes
and yea
the command is in onplayercommandtext
Re: Sscanf problem -
MadeMan - 20.07.2009
Quote:
Originally Posted by ekeleke
the command is in onplayercommandtext
|
In OnPlayerCommandText? Should be out
Re: Sscanf problem -
Pawno_Master - 20.07.2009
Ok i'll try
Re: Sscanf problem -
Pawno_Master - 20.07.2009
Srry for double post
if i put it outside of onplayercommandtext i get these errors
Код:
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1862) : error 055: start of function body without function header
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1863) : error 010: invalid function or declaration
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1864) : error 010: invalid function or declaration
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(2158) : warning 203: symbol is never used: "dcmd_heal"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
Re: Sscanf problem -
MadeMan - 20.07.2009
Can you show lines 1862 - 1864?
Re: Sscanf problem -
Pawno_Master - 20.07.2009
1862 {
1863 dcmd(heal, 4, cmdtext);
1864 return 0;
1865 }
Re: Sscanf problem -
MadeMan - 20.07.2009
Maybe you misunderstood something but dcmd(heal, 4, cmdtext); should be inside OnPlayerCommandText and dcmd_heal(playerid, params[]) outside.
Re: Sscanf problem -
Pawno_Master - 20.07.2009
oh i did that
now i only have one warning
but it is a stupid warning... unreachable code
Код:
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1599) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
i have done what you said