09.06.2014, 03:02
(
Последний раз редактировалось Valdemiro; 18.06.2014 в 15:32.
)
RESOLVIDO
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, cX, cY, cZ)) // Tecla » [ \| ]
{
static Ladrao[MAX_PLAYER_NAME], sStr[70];
GetPlayerName(playerid, Ladrao, sizeof(Ladrao));
if(Roubando[playerid] == 1) return SendClientMessage(playerid, 0xE31919FF, "[~] Vocк jб estб assaltando!");
format(sStr, sizeof(sStr), "[NOTНCIAS] %s[%d] estб roubando um local!", Ladrao, playerid);
SendClientMessageToAll(0xE31919FF, sStr);
format(sStr, sizeof(sStr), "Espere no local %d minutos para concluir o saqueamento!", TempoRoubo);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+1);
SendClientMessage(playerid, 0xC9C9C9FF, sStr);
MK[playerid] = SetTimer("Roubou", 60000*TempoRoubo, false); // defini que a variбvel Mk para o player й o SetTimer
Roubando[playerid] = 1;
return 1;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
static Matou[MAX_PLAYER_NAME], Morreu[MAX_PLAYER_NAME], sStr[90];
GetPlayerName(killerid, Matou, sizeof(Matou));
GetPlayerName(playerid, Morreu, sizeof(Morreu));
format(sStr, sizeof(sStr), "[NOTНCIAS] %s[%d] matou o ladrгo %s[%d]", Matou, killerid, Morreu, playerid);
if(Roubando[playerid] == 1)
{
SendClientMessage(playerid, 0xE31919FF, "[~] Vocк morreu quando estava roubando!");
Roubando[playerid] = 0;
KillTimer(MK[playerid]);// Matando o Tempo
return 1;
}
if(Roubando[killerid] == 1)
{
SendClientMessage(playerid, 0xE31919FF, "[~] Vocк matou o ladrгo!");
Roubando[killerid] = 0;
return 1;
}
return 1;
}