26.11.2012, 00:52
Olб!
Eu quero que quando o killerid matar o playerid apareзa um textdraw para o killerid e apуs 3 segundos o textdraw desapareзa.
Fiz o seguinte cуdigo:
Mas o timer nгo й iniciado ou nгo estб executando o cуdigo, oque estб errado?
cуdigo dos timers:
Eu quero que quando o killerid matar o playerid apareзa um textdraw para o killerid e apуs 3 segundos o textdraw desapareзa.
Fiz o seguinte cуdigo:
pawn Код:
if(killerid == INVALID_PLAYER_ID)
{
SendDeathMessage(INVALID_PLAYER_ID, playerid, 53);
ResetPlayerMoneyEx(playerid);
}
else
{
SendDeathMessage(killerid, playerid, reason);
if(GetPlayerMoneyEx(playerid) > 0)
{
if(mVida[killerid] == 1)
{
if(GetPlayerMoneyEx(playerid) >= 1000)
{
new string[128];
format(string, sizeof(string), "+$%i", GetPlayerMoneyEx(playerid));
TextDrawSetString(MoreMoney, string);
TextDrawShowForPlayer(killerid, MoreMoney);
GivePlayerMoneyEx(killerid, GetPlayerMoneyEx(playerid)-300);
ResetPlayerMoneyEx(playerid);
SetTimer("MoreMoney", 3000, false);
}
else
{
new string[128];
format(string, sizeof(string), "+$%i", GetPlayerMoneyEx(playerid));
TextDrawSetString(MoreMoney, string);
TextDrawShowForPlayer(killerid, MoreMoney);
GivePlayerMoneyEx(killerid, GetPlayerMoneyEx(playerid));
ResetPlayerMoneyEx(playerid);
}
}
else
{
new string[128];
format(string, sizeof(string), "+$%i", GetPlayerMoneyEx(playerid));
TextDrawSetString(MoreMoney, string);
TextDrawShowForPlayer(killerid, MoreMoney);
GivePlayerMoneyEx(killerid, GetPlayerMoneyEx(playerid));
ResetPlayerMoneyEx(playerid);
}
}
}
cуdigo dos timers:
pawn Код:
public mMoney(playerid)
{
TextDrawHideForPlayer(playerid, MoreMoney);
TextDrawSetString(MoreVida, "-$300");
TextDrawShowForPlayer(playerid, MoreVida);
SetTimer("MoreVida", 2000, true);
}
public MoreV(playerid)
{
new Float:Vida;
GetPlayerHealth(playerid, Vida);
if(Vida <= 99)
{
SetPlayerHealth(playerid, Vida+15);
GivePlayerMoney(playerid, -300);
}
TextDrawHideForPlayer(playerid, MoreVida);
}