sscanf2 MATCH_NAME_PARTIAL
#1

well ok idk but how is this gonna work first how can i make it globally to 1, after that how can we make if the player types uchiha and the name is sasuke_uchiha it will work with making MATCH_NAME_PARTIAL but how to do that if there are 3 online player 1 me and other two Sasuke_uchiha and Itachi_Uchiha if i type uchiha it should say "Uchiha is found in multiple name please be more specific" and i am using specifiers "U".
And Can You make the example with this command
pawn Код:
CMD:jail(playerid,params[])
{
    new TargetID,mins,hours,reason[100], string[256];
    if(pInfo[playerid][Adminlevel] < 5) return SCM(playerid, COLOR_ERROR,""ERROR_MESSAGE"");
    if(!pInfo[playerid][LoggedInAsAdmin]) return SCM(playerid,COLOR_ERROR,""ERROR_MESSAGE"");
    if(caged[TargetID] == 1) return SCM(playerid,COLOR_ERROR,CAGED_ERROR);
    if(sscanf(params, "uI(1)I(30)S()[50]", TargetID,hours,mins,reason)) return SCM(playerid, COLOR_ERROR, "Usage: /jail (Name/ID) (Hours) (Mins) (Reason)");
    if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID )) return SCM(playerid, COLOR_ERROR, ERROR_INVALID_PLAYER);
    if(pInfo[TargetID][Adminlevel] && TargetID != playerid) return SCM(playerid,COLOR_ERROR,"You Can't Use this Command On An Admin");
    if(pInfo[TargetID][Jailed] == 0)
    {
        pInfo[TargetID][pJailHour] =hours;
        pInfo[TargetID][pJailMinute] =mins;
        JailPlayer(TargetID);
        SetPlayerInterior(TargetID,10);
        pInfo[TargetID][Jailed] = 1;
        if(!strlen(reason)) format(string,sizeof(string),">> JAIL: "ORANGE"%s (%d)"ADMIN" (Admin Jail) No Reason Specified",pInfo[TargetID][playername],TargetID);
        else format(string,sizeof(string),">> JAIL: "ORANGE"%s (%d)"ADMIN" (Admin Jail) (reason: %s)",pInfo[TargetID][playername],TargetID,reason);
        SCMA(COLOR_ADMIN,string);
    }
    else
    {
        format(string,sizeof(string),"You have released %s (%d) form jail",pInfo[TargetID][playername],TargetID);
        SCM(playerid,COLOR_SKYBLUE,string);
        SCM(TargetID,COLOR_SKYBLUE,"You have been released from jail by an admin.");
        JailRelease(TargetID);
    }
    return 1;
}
and how can i make multiple sscanf like if we don't enter the the time and just the reason skip it if we want or we can type the time if we want some thing like
pawn Код:
if(sscanf(params, "uI(1)I(30)S()[50]", TargetID,hours,mins,reason))
how can i make that if i use this way it works and if i use this way /jail [playerid] [hour] [minute] [reason] it should work but if u i use /jail [playerid] [reason] this way should work to and here hour and minute are 1:30 (their default values)
Reply


Messages In This Thread
sscanf2 MATCH_NAME_PARTIAL - by AroseKhanNiazi - 24.07.2014, 11:46
Re: sscanf2 MATCH_NAME_PARTIAL - by admiralspeedy - 24.07.2014, 14:07
Re: sscanf2 MATCH_NAME_PARTIAL - by nmader - 24.07.2014, 14:09
Re: sscanf2 MATCH_NAME_PARTIAL - by AroseKhanNiazi - 24.07.2014, 14:11
Re: sscanf2 MATCH_NAME_PARTIAL - by BroZeus - 24.07.2014, 14:39
Re: sscanf2 MATCH_NAME_PARTIAL - by AroseKhanNiazi - 24.07.2014, 14:42
Re: sscanf2 MATCH_NAME_PARTIAL - by BroZeus - 24.07.2014, 15:23
Re: sscanf2 MATCH_NAME_PARTIAL - by AroseKhanNiazi - 24.07.2014, 17:38
Re: sscanf2 MATCH_NAME_PARTIAL - by AroseKhanNiazi - 24.07.2014, 21:21

Forum Jump:


Users browsing this thread: 1 Guest(s)