new n[24],pos[3];
CMD:eletad(playerid,params[])
{
new str[128];
foreach(Player,i) {
GetPlayerPos(i,pos[1],pos[2],pos[3]);
GetPlayerName(i,n,24);
if(IsPlayerInRangeOfPoint(playerid,pos[1],pos[2],pos[3],2.0)) {
format(str,128,\"Biztosan fel akarod tölteni %s[%d] életét?\",n,i);
ShowPlayerDialog(playerid,1163,DIALOG_STYLE_MSGBOX,\"\",str,\"Feltölt!\",\"Mégse\");
return 1;
}
new Timer[MAX_PLAYERS];
public timeer(playerid);
public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{
if(dialogid == 1163)
{ foreach(Player,i) { if(IsPlayerInRangeOfPoint(playerid,pos[1],pos[2],pos[3],2.0)) {
if(response) return Timer[playerid] = SetTimerEx(\"timeer\",500,true,\"d\",i);
}}}
return 1;
}
public timeer(playerid);
{
SetPlayerHealth(playerid,GetPlayerHealth(playerid) + 2);
if(GetPlayerHealth(playerid) > 100) return KillTimer(Timer), SetPlayerHealth(playerid,100);
return 1;
}
// lehet hogy rossz, rögtönzött meg nem is tudom most ellenõrizni..