/unjail
#1

Okay.. Well my gamemode.. Didn't have /unjail.. so i went add a /unjail.. it would take them to the spot.. but won't take there mins of jail time?
Code:
Quote:

if(strcmp(cmd, "/unjail", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /unjail [playerid/PartOfName] [time(minutes)]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 2)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You UnJailed %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* You were unJailed by Admin %s.", sendername);
SendClientMessage(playa, COLOR_LIGHTRED, string);
ResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 6);
SetPlayerPos(playa, 267.4746,77.3196,1001.0391);
format(string, sizeof(string), "You are unjailed from your %d minutes.", money);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}

Please help, thanks
Reply
#2

Try this hon. You will probobly want to indent that correctly but thats something you have to do :P
Код:
if(strcmp(cmd, "/unjail", true) == 0)
{
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /unjail [playerid/PartOfName]");
	new playa;
 	playa = ReturnUser(tmp);
 	if (PlayerInfo[playerid][pAdmin] >= 2)
	{
 		if(playa != INVALID_PLAYER_ID)
  		{
   		GetPlayerName(playa, giveplayer, sizeof(giveplayer));
    		GetPlayerName(playerid, sendername, sizeof(sendername));
     	format(string, sizeof(string), "* You UnJailed %s.", giveplayer);
     	SendClientMessage(playerid, COLOR_LIGHTRED, string);
      	format(string, sizeof(string), "* You were unjailed by Admin %s.", sendername);
      SendClientMessage(playa, COLOR_LIGHTRED, string);
      ResetPlayerWeapons(playa);
      WantedPoints[playa] = 0;
      PlayerInfo[playa][pJailed] = 0;
      PlayerInfo[playa][pJailTime] = 0;
      SetPlayerInterior(playa, 6);
      SetPlayerPos(playa, 267.4746,77.3196,1001.0391);
      SendClientMessage(playa, COLOR_LIGHTBLUE, string);
    	}
	}
 	else return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
 	return 1;
}
Reply
#3

Look at your script and find this

pawn Код:
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
Now change that into this...

pawn Код:
PlayerInfo[playa][pJailed] = 0;
PlayerInfo[playa][pJailTime] = money*0;
Reply
#4

Thanks for the help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)