SA-MP Forums Archive
Help with aunjail Command - 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: Help with aunjail Command (/showthread.php?tid=599873)



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 ^^