Why Is The Reason Now Showing?
#1

pawn Код:
dcmd_adjail(playerid,params[])
{
    new string[128];
    new ID;
    new cmdtime;
    new cmdreason[100];
    if(sscanf(params, "ui", ID, cmdtime))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adjail (Player Name/ID) (Seconds) (Reason)");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot jail them.");
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(IsSpawned[ID] != 1)
    {
        format(string,sizeof(string),"%s(%d) is not spawned. You cannot jail them.");
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    format(string,sizeof(string),"[ADMIN] Administrator has jailed %s(%d) to San Fierro Prison for %d seconds. (Reason: %s )",PlayerName(ID),ID,cmdtime,cmdreason);
    SendClientMessageToAll(COLOR_ADMIN,string);
    format(string,sizeof(string),"9[ADMIN] Administrator has jailed %s(%d) to San Fierro Prison for %d seconds. (Reason: %s )",PlayerName(ID),ID,cmdtime,cmdreason);
    IRC_GroupSay(gGroupID,IRC_CHANNEL,string);

    //TextDraw
    TextDrawShowForPlayer(ID,JailTimer[ID]);
   
    //Others
    ResetPlayerWeapons(ID);

    new rnd = random(sizeof(JailSpawnPoints));
    JailTime[ID] =cmdtime;
    IsCuffed[ID] =0;
    CuffTime[ID] =0;
    TotalJailTime[ID] =cmdtime;
    SetPlayerInterior(ID,10);
    SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
    SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
    TogglePlayerControllable(ID,1);
    SetPlayerWantedLevel(ID,0);
    SetPlayerToTeamColour(ID);
    return 1;
}
Why doesnt the Cmdreason show up?
Reply
#2

Because it's not in sscanf statement.
Код:
if(sscanf(params, "uis[100]", ID, cmdtime, cmdreason))
Reply
#3

Quote:
Originally Posted by YJIET
Посмотреть сообщение
Because it's not in sscanf statement.
Код:
if(sscanf(params, "uis[100]", ID, cmdtime, cmdreason))
I realised that but it is still not working
Reply
#4

oh nvm it is working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)