Timer
#1

Hello, can anyone help me, what do i need to add there to make the player wait 2 minutes before using the command again?

PHP код:
CMD:heilen(playerid,params[])
{
    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);
        }
    }
    return 
1;

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: 2 Guest(s)