Cant get SSCANF to work.
#1

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.
Reply
#2

It's not SSCANF. Make sure you put this command out of any callback; or are you sure you've included the zcmd include?
Reply
#3

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;
    }
}
Reply
#4

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.
Reply
#5

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 <.<
Reply
#6

Are you guys stupid? i thought ZCMD doesn't work with OnPlayerCommandText...
Reply
#7

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 :>
Reply
#8

Quote:
Originally Posted by Max_Coldheart
Посмотреть сообщение
Are you guys stupid? i thought ZCMD doesn't work with OnPlayerCommandText...
Calm down, and read.
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)