SA-MP Forums Archive
Why Is The Reason Now Showing? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Why Is The Reason Now Showing? (/showthread.php?tid=351516)



Why Is The Reason Now Showing? - JAMMIEISFTW - 16.06.2012

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?


Re: Why Is The Reason Now Showing? - Stylock - 16.06.2012

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



Re: Why Is The Reason Now Showing? - JAMMIEISFTW - 16.06.2012

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


Re: Why Is The Reason Now Showing? - JAMMIEISFTW - 16.06.2012

oh nvm it is working.