Timer
#8

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
PHP код:
forward heilen_Timer(playerid);
new 
heilen_Command[MAX_PLAYERS];
public 
heilne_Timer(playerid)
{
    
heilen_Command[playerid] = 0;
}
CMD:heilen(playerid,params[])
{
    if(
heilen_Command[playerid] == 1)
    {
        
SendClientMessage(playerid,0xFF0000FF,"You can use this command once every 2 minutes!");
    }
    else
    {
        new 
targetid;
        new 
string[128];
        if(
sscanf(params"u"targetid))
        return 
SendClientMessage(playeridFARBE_ROT"/heilen [Spielerid]");
        if(
SpielerInfo[playerid][sDoktor] == 0)
        return 
SendClientMessage(playeridFARBE_ROT"Du bist kein Doktor!");
        if(
IsPlayerNPC(targetid))
        return 
SendClientMessage(playeridFARBE_ROT"Du kannst keine Computer heilen!");
        if(
SpielerInfo[playerid][sDieanderen] == 1)
        return 
SendClientMessage(playeridFARBE_ROT"Du bist nicht in der Gruppe 'Die Ьberlebenden'.");
        if(
targetid == playerid) return SendClientMessage(playeridFARBE_ROT"Du kannst dich selbst nicht heilen!");
        new 
targetname[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME];
        
GetPlayerName(targetidtargetnamesizeof(targetname));
        
GetPlayerName(playeridsendernamesizeof(sendername));
        new 
Float:x,Float:y,Float:z;
        
GetPlayerPos(playerid,x,y,z);
        new 
Float:tx,Float:ty,Float:tz;
        
GetPlayerPos(targetid,tx,ty,tz);
        if(!
IsPlayerInRangeOfPoint(playerid6.0tx,ty,tz))
        return 
SendClientMessage(playeridFARBE_ROT"Dieser Spieler ist nicht in deiner Nдhe!");
        {
            
GameTextForPlayer(playerid"Heilt den Spieler...",5,3000);
            new 
message random(2);
            if(
message == 0)
            {
                
GameTextForPlayer(playerid"Du konntest diesen Spieler nicht heilen.",5,3000);
                
format(stringsizeof(string), "Doktor %s hat versucht %s zu heilen, ist aber gescheitert."sendernametargetname);
                
ProxDetector(30.0playeridstringFARBE_ROT,FARBE_ROT,FARBE_ROT,FARBE_ROT,FARBE_ROT);
            }
            if(
message == 1)
            {
                
GameTextForPlayer(playerid"Du hast diesen Spieler geheilt!",5,3000);
                
GameTextForPlayer(targetid"Geheilt",5,3000);
                
format(stringsizeof(string), "Doktor %s hat %s geheilt."sendernametargetname);
                
ProxDetector(30.0playeridstringFARBE_GRUEN,FARBE_GRUEN,FARBE_GRUEN,FARBE_GRUEN,FARBE_GRUEN);
                
SetPlayerHealth(targetid100);
            }
        }
        
heilen_Command[playerid] = 1;
        
SetTimerEx("heilen_Timer",120000,false,"d",playerid);
        return 
1;
    }

Should work
I will try it
Reply


Messages In This Thread
Timer - by svaba - 14.08.2011, 11:47
Re: Timer - by [MG]Dimi - 14.08.2011, 11:51
Re: Timer - by svaba - 14.08.2011, 11:56
Re: Timer - by TouR - 14.08.2011, 11:58
Re: Timer - by [MG]Dimi - 14.08.2011, 11:59
Re: Timer - by Grim_ - 14.08.2011, 12:15
Re: Timer - by svaba - 14.08.2011, 12:43
Re: Timer - by svaba - 14.08.2011, 12:45

Forum Jump:


Users browsing this thread: 1 Guest(s)