Help with aunjail Command
#1

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(playeridparams[])
{
    new 
giveplayeridgiveplayer[25], playername[25];
    if (
adlvl[playerid] < 3) return 0;
    if (
sscanf(params"u"giveplayerid)) return SendClientMessage2(playeridCOLOR_ORANGE"Usage: /aunjail [playerid]");
    if (!
IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playeridCOLOR_RED"Error: Inactive player id!");
    
GetPlayerName(giveplayeridgiveplayerMAX_PLAYER_NAME);
    if (
jailedtime[giveplayerid] == 0) return SendPlayerFormattedText(playeridCOLOR_RED"Error: %s isn't in jail!"giveplayer"");
    
jailedtime[giveplayerid] = 0;
    
dini_Unset(AddDirFile(dir_userfilesgiveplayer), "jailtime");
    
dini_Unset(AddDirFile(dir_userfilesgiveplayer), "jailloc");
    
SetPlayerInterior(giveplayerid0);
    
SetPlayerVirtualWorld2(giveplayerid0);
    
SetPlayerPos(giveplayeridwspawns[dspawn[giveplayerid]][0], wspawns[dspawn[giveplayerid]][1], wspawns[dspawn[giveplayerid]][2] + 1.0);
    
SetPlayerFacingAngle(giveplayeridwspawns[dspawn[giveplayerid]][3]);
    
SetCameraBehindPlayer(giveplayerid);
    
TogglePlayerControllable(giveplayerid1);
    
GetPlayerName(playeridplayernameMAX_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.
Reply
#2

That line seems fine to me
Reply
#3

That's what I thought. But I don't understand why I am getting this warning.
Reply
#4

Try to use format and then print(string)
Reply
#5

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."playernamegiveplayer); 
Thanks for the help though :P
Reply
#6

lol ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)