Help with aunjail Command -
Tass007 - 31.01.2016
Hi all, trying to make an aunjail command, however I have 1 warning. All the research I have done says stuff to do with vehicles, yet this command doesn't do anything with vehicles.
Here is code
PHP код:
CMD:aunjail(playerid, params[])
{
    new giveplayerid, giveplayer[25], playername[25];
    if (adlvl[playerid] < 3) return 0;
    if (sscanf(params, "u", giveplayerid)) return SendClientMessage2(playerid, COLOR_ORANGE, "Usage: /aunjail [playerid]");
    if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
    GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
    if (jailedtime[giveplayerid] == 0) return SendPlayerFormattedText(playerid, COLOR_RED, "Error: %s isn't in jail!", giveplayer, "");
    jailedtime[giveplayerid] = 0;
    dini_Unset(AddDirFile(dir_userfiles, giveplayer), "jailtime");
    dini_Unset(AddDirFile(dir_userfiles, giveplayer), "jailloc");
    SetPlayerInterior(giveplayerid, 0);
    SetPlayerVirtualWorld2(giveplayerid, 0);
    SetPlayerPos(giveplayerid, wspawns[dspawn[giveplayerid]][0], wspawns[dspawn[giveplayerid]][1], wspawns[dspawn[giveplayerid]][2] + 1.0);
    SetPlayerFacingAngle(giveplayerid, wspawns[dspawn[giveplayerid]][3]);
    SetCameraBehindPlayer(giveplayerid);
    TogglePlayerControllable(giveplayerid, 1);
    GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
    SendAllFormattedText(COLOR_YELLOW, "%s has been unjailed early by Admin.", giveplayer);
    printf("[unjail] %s has been unjailed early by Admin.", giveplayer);
    return 1;
}Â
Warning is
Код:
E:\All Folders\Hobbies\Server Hosting\SA-MP\_RNT Gaming\gamemodes\RNTG.pwn(22895) : warning 202: number of arguments does not match definition
Line of code is
PHP код:
    printf("[unjail] %s has been unjailed early by Admin.", giveplayer);Â
Please help me. I will of course + Rep.
Re: Help with aunjail Command -
BiosMarcel - 31.01.2016
That line seems fine to me
Re: Help with aunjail Command -
Tass007 - 31.01.2016
That's what I thought. But I don't understand why I am getting this warning.
Re: Help with aunjail Command -
BiosMarcel - 31.01.2016
Try to use format and then print(string)
Re: Help with aunjail Command -
Tass007 - 31.01.2016
Whoopies, I made a mistake I gave you the wrong line of where the warning is.
Warning is on this line
PHP код:
    SendAllFormattedText(COLOR_YELLOW, "%s has been unjailed early by Admin.", giveplayer);Â
EDIT: LOL! I fixed it. After looking at the wrong warning line...
Fix is
PHP код:
    SendAllFormattedText(COLOR_YELLOW, "%s has been unjailed early by Admin.", playername, giveplayer);Â
Thanks for the help though :P
Re: Help with aunjail Command -
BiosMarcel - 31.01.2016
lol ^^