sscanf2 Example.
#1

Hey there. Is there anyone who can give me an example of I can use sscanf to do this instead of explode function ?

pawn Код:
stock AssignPlayerTickets(playerid, tickets[])
{
    new tmp[MAX_PLAYER_TICKETS][32];
    explode(tmp, tickets, "|");
    for(new i = 0; i < MAX_PLAYER_TICKETS; i ++)
    {
        PlayerInfo[playerid][pTickets][i] = strval(tmp[i]);
    }
}
I'm not that good with sscanf,I'm still learning how to make use of it.
Any help is much appreciated.
Reply
#2

PHP код:

new tmp[MAX_PLAYER_TICKETS][32], selse[sizeof(tickets)];
sscanf(tickets"s[MAX_PLAYER_TICKETS]p<|>s[sizeof(tickets)]"tmpselse); 
Before the delimiter, the string will be cut and stored in tmp, and after the delimiter, it will be stored in selse.
Reply
#3

I'll try it , thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)