28.07.2011, 16:53
guys i want to make when ill type jail and if i i type the ID of the player who is alredy in jail to send me message "That player is alredy in jail." i have tryed so many ways to make that but still cant get the right one so here is the code:
Thanks all
pawn Код:
CMD:jail(playerid, params[])
{
if(IsPlayerAdmin2[playerid] == 2)
{
new targetid, Text:JailTextDraw, reason[128], msg[64], name[46];
if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /jail [id] [reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "That player is not online.");
GetPlayerName(playerid, name, sizeof(name));
format(msg, sizeof(msg), "%s was jailed. Reason: %s. Time: 120sec.", name, reason);
SendClientMessageToAll(COLOR_RED, msg);
SetTimer("jailtime", 120000, false);
SetPlayerInterior(targetid, 6);
SetPlayerPos(targetid, 265.34756469727, 77.521759033203, 1001.0390625);
JailTextDraw = TextDrawCreate(327.000000, 377.000000, "X");
TextDrawAlignment(JailTextDraw, 2);
TextDrawBackgroundColor(JailTextDraw, 255);
TextDrawFont(JailTextDraw, 2);
TextDrawLetterSize(JailTextDraw, 0.620000, 3.200000);
TextDrawColor(JailTextDraw, -1);
TextDrawSetOutline(JailTextDraw, 0);
TextDrawSetProportional(JailTextDraw, 1);
TextDrawSetShadow(JailTextDraw, 1);
CountdownTextDraw(targetid, JailTextDraw, 120);
return 1;
}
return 1;
}
