07.10.2010, 15:32
I was working again on this irritating script, "Ajail" and it doesn't show the reason for the Ajail, and the time, it shows me 0 minutes all the time, on the message to all.
pawn Код:
if(strcmp(cmd, "/ajail", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ajail [PlayerID/PartOfName] [Time(minutes)] [Reason]");
return 1;
}
new playa;
new jailReason[128];
new JailTime;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You Jailed %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
ResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerPos(playa,1769.37341309,178.79183960,1369.28161621);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s was admin jailed by %s for %d minutes, Reason: %s ",giveplayer, sendername, JailTime, jailReason);
BroadCast(0xFF4646FF,string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}