28.10.2012, 18:27
pawn Код:
#include <a_samp>
new pname[256];
new string[256];
new blockjail[MAX_PLAYERS] = 0;
public OnPlayerConnect(playerid)
{
blockjail[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
blockjail[playerid] = 0;
return 1;
}
public OnPlayerDeath(playerid,killerid)
{
if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
GetPlayerName(killerid,pname,sizeof(pname));
format(string, sizeof(string), "{FF0000}%s Foi preso [motivo: Matou com o veiculo ] [Tempo: 1 Minuto ]",pname);
SendClientMessageToAll(-1, string);
blockjail[killerid] = 1;
GivePlayerMoney(killerid, -3500);
SetPlayerPos(killerid, 197.6661, 173.8179, 1003.0233);
SetPlayerInterior(killerid, 3);
SetTimerEx("SetPlayerJail", 60000, 0, "i", killerid);
}
return 1;
}
forward SetPlayerJail(killerid);
public SetPlayerJail(killerid)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(killerid, giveplayer, sizeof(giveplayer));
SetPlayerInterior(killerid,0);
SpawnPlayer(killerid);
blockjail[killerid] = 0;
GameTextForPlayer(killerid, "~w~~h~voce esta ~r~~h~livre!", 1000,1);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(blockjail[playerid] == 1) return SendClientMessage(playerid, -1, "Vocк nгo pode digitar nenhum comando enquanto estiver preso!");
//Comando /kill
if (strcmp("/emo", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, -1, "Vocк й um emo!!! ");
return true;
}
return 1;
}
pawn Код:
new blockjail[MAX_PLAYERS];
pawn Код:
new blockjail[200];
Espero ter sido ъtil.