new Hospital[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
Hospital[playerid] = 1;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(Hospital[playerid] == 1)
{
SetPlayerPos(playerid, 1177.3113,-1323.2871,14.0644);
TogglePlayerControllable(playerid, false);
SetTimerEx("Curando", 5000, false, "i", playerid);
SendClientMessage(playerid, 0xFF3030FF,"[Hospital]Vocк Estб Sendo Curado...");
}
return 1;
}
forward Curando(playerid);
public Curando(playerid)
{
TogglePlayerControllable(playerid, true);
Hospital[playerid] = 0;
SetPlayerPos(playerid, 1177.3113,-1323.2871,14.0644);
GivePlayerMoney(playerid, -100);
SendClientMessage(playerid, VERMELHO,"[Hospital]Vocк foi Curado por $200");
}
public Curando(playerid)
{
TogglePlayerControllable(playerid, true);
Hospital[playerid] = 0;
SetPlayerPos(playerid, 1177.3113,-1323.2871,14.0644);
GivePlayerMoney(playerid, -100);
SendClientMessage(playerid, VERMELHO,"[Hospital]Vocк foi Curado por $200");
return 1; //coloca o return
}
Entгo,meu hospital ta com mensagem duplicada.
As mensagens tгo aparecendo 2x,por exemplo,se no cуdigo ta pra tirar $100 do player,ele tira $200,por que duplica o cуdigo. Cуdigo aqui: Topo: pawn Код:
pawn Код:
|
public OnPlayerDeath(playerid, killerid, reason)
{
Hospital[playerid] = 1;
SetPlayerPos(playerid, 1177.3113,-1323.2871,14.0644);
TogglePlayerControllable(playerid, false);
SetTimerEx("Curando", 5000, false, "i", playerid);
SendClientMessage(playerid, 0xFF3030FF,"[Hospital]Vocк Estб Sendo Curado...");
return 1;
}
forward Curando(playerid);//topo do gm
public Curando(playerid)
{
TogglePlayerControllable(playerid,true);
Hospital[playerid] = 0;
SetPlayerPos(playerid, 1177.3113,-1323.2871,14.0644);
GivePlayerMoney(playerid, -100);
SendClientMessage(playerid, VERMELHO,"[Hospital]Vocк foi Curado por $100");
return 1;
}
public Curando(playerid)
{
if(Hospital[playerid] == 1)
{
TogglePlayerControllable(playerid, true);
Hospital[playerid] = 0;
SetPlayerPos(playerid, 1177.3113,-1323.2871,14.0644);
GivePlayerMoney(playerid, -100);
SendClientMessage(playerid, VERMELHO,"[Hospital]Vocк foi Curado por $100");
}
return 1;
}