04.10.2010, 12:30
So I made this command Ajail, but when I type a time It only jails the player and he is stuck there forever I tired to use variables but still doesn't work.
Here is the whole code:
Here is the whole code:
pawn Код:
CMD:ajail(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF4646FF, "You are not authorized to use that command !");
else
{
new PlayerInfo[MAX_PLAYERS][pInfo];
new Jailed[MAX_PLAYERS];
new otherId;
new sendername[MAX_PLAYER_NAME];
new string[256];
new pID, GivenName[MAX_PLAYER_NAME];
if(sscanf(params, "u", otherId,Jailed)) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /ajail [PlayerID/PartOfName] [Time(minutes)] [Reason]");
GetPlayerName(pID, GivenName, sizeof(GivenName));
format(string, sizeof(string), "* You Jailed %s.", GivenName);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
if(otherId == INVALID_PLAYER_ID) return SendClientMessage(otherId, 0xAFAFAFAA, "Invalid Player ID");
{
Jailed[otherId] = 1;
PlayerInfo[otherId][pJailTime] = 1;
new Float:x, Float:y, Float:z;
GetPlayerPos(otherId, x, y, z);
SetPlayerPos(otherId,1769.37341309,178.79183960,1369.28161621);
GetPlayerName(playerid, sendername, sizeof(sendername)); // This is for admin name
format(string, sizeof(string), "* You have been Admin jailed by Admin %s ", sendername );
SendClientMessage(playerid, 0xFF4646FF, string);
}
}
return 1;
}
this is at the top.
pawn Код:
enum pInfo
{
pJailTime};