SSCANF Problem
#1

Hey.

I have a question:

Can i out Either a string or an id into an array using sscanf?

like:
pawn Код:
if (sscanf(params, "s||u", params[0]))
i can't figureout how i do this

BTW:
I need it for a /goto command either to teleport to a person or to a certain place.
Reply
#2

In what case do you want this?
If you want it for playername/ID, use 'u'.
Reply
#3

i want it for a place or for user-id.
so:
if i type /goto bsn i will be teleported to bsn
if i type in /goto 1 i go to id 1.

But how?
Reply
#4

Try this:

pawn Код:
new userid, place[32];
if(sscanf(params, "u", userid))
{
    if(sscanf(params, "s", place))
    {
        // Wrong syntax
    }
    else
    {
        // goto place
    }
}
else
{
    // goto player
}
Reply
#5

didnt work... doesnt matter.
i made a new command (/gotop)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)