what the problem with this in sscanf?
#6

thx mr ****** but am i doing this correct? the first string will be the option that save up to 10 cells which only involve between name and location only then the second string is for the name and loc thats why i made new name and loc variable that will save 32 cells for the name and location you will input

pawn Код:
new i,option[10],string[200];
    if(sscanf(params, "is[10]",i,option))
    {
        SCM(playerid, -1, "[Usage]: /credit [robid] [option]");
        SCM(playerid, -1, "OPTIONS: name | location | robcash");
        return 1;
    }
    if(!strcmp(option, "name", true, 4))
    {
        new name[32];
        if(sscanf(params, "is[10]s[32]",i,option,name)) return SCM(playerid,-1, "[Usage]: /credit [robid] name [name]");
        if(PickInfo[i][pPick] == 0) return SendClientMessage(playerid,-1, "Invalid door id.");
        format(string, sizeof(string), " You have set rob ID %d's name to %s",i,name);
        SCM(playerid,COLOR_LIGHTBLUE, string);
        PickInfo[i][pRname] = name;
    }
    if(!strcmp(option, "location", true, 8))
    {
        new loc[32];
        if(sscanf(params, "is[10]s[32]",i,option,loc)) return SCM(playerid,-1, "[Usage]: /credit [robid] location [loc]");
        if(PickInfo[i][pPick] == 0) return SendClientMessage(playerid,-1, "Invalid door id.");
        format(string, sizeof(string), " You have set rob ID %d's location to %s",i,loc);
        SCM(playerid,COLOR_LIGHTBLUE, string);
        PickInfo[i][pLoc] = loc;
    }
Reply


Messages In This Thread
what the problem with this in sscanf? - by drichie - 07.07.2013, 05:51
Re: what the problem with this in sscanf? - by SwisherSweet - 07.07.2013, 06:33
Re: what the problem with this in sscanf? - by drichie - 07.07.2013, 07:12
Re: what the problem with this in sscanf? - by Konstantinos - 07.07.2013, 09:19
Re: what the problem with this in sscanf? - by drichie - 08.07.2013, 13:35
Re: what the problem with this in sscanf? - by drichie - 08.07.2013, 13:53
Re: what the problem with this in sscanf? - by drichie - 08.07.2013, 14:39
Re: what the problem with this in sscanf? - by Konstantinos - 08.07.2013, 15:28

Forum Jump:


Users browsing this thread: 2 Guest(s)