Cant get SSCANF to work. -
Chriham3 - 25.10.2011
Hello. This is my setcompany command.
pawn Код:
COMMAND:setcompany(playerid, params[])
{
new id, num;
if(sscanf(params, "ud", id, num)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setcompany (user) (companyid (1-15)");
return 1;
}
}
However, when I compile I get this error:
Код:
C:\Users\Chuck Norris\Desktop\samp\gamemodes\Scratch.pwn(239) : error 029: invalid expression, assumed zero
C:\Users\Chuck Norris\Desktop\samp\gamemodes\Scratch.pwn(239) : error 017: undefined symbol "cmd_setcompany"
C:\Users\Chuck Norris\Desktop\samp\gamemodes\Scratch.pwn(239) : error 029: invalid expression, assumed zero
C:\Users\Chuck Norris\Desktop\samp\gamemodes\Scratch.pwn(239) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Cant get SSCANF to work. -
[MWR]Blood - 25.10.2011
It's not SSCANF. Make sure you put this command out of any callback; or are you sure you've included the zcmd include?
Re: Cant get SSCANF to work. -
Chriham3 - 25.10.2011
Yes. I have ZCMD included.
This is the whole thing:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
COMMAND:setcompany(playerid, params[])
{
new id, num;
if(sscanf(params, "ud", id, num)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setcompany (user) (companyid (1-15)");
return 1;
}
}
Re: Cant get SSCANF to work. -
KoczkaHUN - 25.10.2011
you forgot a ')' from the if line.
add it: if(sscanf(params, "ud", id, num)
)
Edit: Also you should not place COMMAND: blocks into public OnPlayerCommandText.
Place it outside of any functions.
Re: Cant get SSCANF to work. -
FireCat - 25.10.2011
pawn Код:
COMMAND:setcompany(playerid, params[])
{
new id, num;
if(sscanf(params, "ud", id, num)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setcompany (user) (companyid (1-15)");
}
@[MWR]Blood
Orly? KRAWD. He forgot a )
EDIT:
KoczkaHUN beat me to it <.<
Re: Cant get SSCANF to work. - Max_Coldheart - 25.10.2011
Are you guys stupid? i thought ZCMD doesn't work with OnPlayerCommandText...
Re: Cant get SSCANF to work. -
FireCat - 25.10.2011
Quote:
Originally Posted by Max_Coldheart
Are you guys stupid? i thought ZCMD doesn't work with OnPlayerCommandText...
|
Lolz I didn't see his last post :b
And
Off topic:
YOUR STUPID, FREAKIN GOAT :>
Re: Cant get SSCANF to work. -
KoczkaHUN - 25.10.2011
Quote:
Originally Posted by Max_Coldheart
Are you guys stupid? i thought ZCMD doesn't work with OnPlayerCommandText...
|
Calm down, and read.
Re: Cant get SSCANF to work. - Max_Coldheart - 25.10.2011
Quote:
Originally Posted by FireCat
Lolz I didn't see his last post :b
And
Off topic:
YOUR STUPID, FREAKIN GOAT :>
|
Thanks, goaty
Quote:
Originally Posted by KoczkaHUN
Calm down, and read.
|
Sorry but I'm pretty calm