Help In Countdown +Rep
#1

I Need To When 10 Second is Passed Countdown run and show 3, 2, 1, Go!
And unfreeze player please Give Me True Compelete Codes I Don't Know Why This Not Happen
Thank You

PHP код:
CMD:derby(playeridparams[])
{        
        
My_Interior[playerid] = 15;
        new 
string[128], pName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
        
format(stringsizeof(string), "{6666FF}(/derby) {00CCFF}%s {6666FF}Teleport Shod Be Derby P1"pName);
        
SendClientMessageToAll(0xFFFFFFFFstring);
    
SendClientMessage(playerid,COLOR_RED,"Baraye Khoroj Az Derby Bezanid /leavederby");
        
GameTextForPlayer(playerid,"~y~Khoshoomadi Be ~n~~b~Derby Deathmatch"20003);
        
SetPlayerPos(playerid, -1362.5800931.34891035.9734);
        
SetPlayerInterior(playerid15);
        
SetPlayerVirtualWorld(playerid15);
        
bloodring_id[playerid] = CreateVehicle(504, -1362.5800931.34891035.97340.000, -1);
        
LinkVehicleToInterior(bloodring_id[playerid], 15);
        
SetVehicleVirtualWorld(bloodring_id[playerid], 15);
        
PutPlayerInVehicle(playeridbloodring_id[playerid], 0);
        
TogglePlayerControllable(playerid0);
        
SetTimerEx("unfreeze",10000,false,"i",playerid); 
        
SetPlayerHealth(playerid100);
        
DerbyNumber 1;
        return 
1;
}
forward unfreeze(playerid);
public 
unfreeze(playerid)
{
    
SetTimerEx("Count",100,false,"ii",playerid,3);
    return 
1;
}
forward Count(playerid,time);
public 
Count(playerid,time)
{
    if(
time != 0)
    {
      new 
string[5];
        
format(stringsizeof(string), "%d"time);
        
GameTextForPlayer(playeridstring10005);
    }
    else
    {
        
GameTextForPlayer(playerid"GO!"25003);
        
TogglePlayerControllable(playerid1);
    }
    return 
1;

Reply
#2

Maybe just use how other scripts use it

PHP код:
forward unfreeze(playerid);
public 
unfreeze(playerid)
{
    
SetTimer("Three"10000);
    
SetTimer("Two"20000);
    
SetTimer("One"30000);
    
SetTimer("Go"40000);
    return 
1;


forward Three();
public 
Three()
{
     
SendClientMessageToAllEx(COLOR_LIGHTBLUE"3");
    return 
1;
}

forward Two();
public 
Two()
{
    
SendClientMessageToAllEx(COLOR_LIGHTBLUE"2");
    return 
1;
}

forward One();
public 
One()
{
    
SendClientMessageToAllEx(COLOR_LIGHTBLUE"1");
     return 
1;
}

forward Go();
public 
Go()
{
    
SendClientMessageToAllEx(COLOR_LIGHTBLUE"Go!");
     return 
1;

Reply
#3

This one should work:
PHP код:
new TimerUnfreezeAfterC;

CMD:derby(playeridparams[]) 
{         
        
My_Interior[playerid] = 15
        new 
string[128], pName[MAX_PLAYER_NAME]; 
        
GetPlayerName(playeridpNameMAX_PLAYER_NAME); 
        
format(stringsizeof(string), "{6666FF}(/derby) {00CCFF}%s {6666FF}Teleport Shod Be Derby P1"pName); 
        
SendClientMessageToAll(0xFFFFFFFFstring); 
    
SendClientMessage(playerid,COLOR_RED,"Baraye Khoroj Az Derby Bezanid /leavederby"); 
        
GameTextForPlayer(playerid,"~y~Khoshoomadi Be ~n~~b~Derby Deathmatch"20003); 
        
SetPlayerPos(playerid, -1362.5800931.34891035.9734); 
        
SetPlayerInterior(playerid15); 
        
SetPlayerVirtualWorld(playerid15); 
        
bloodring_id[playerid] = CreateVehicle(504, -1362.5800931.34891035.97340.000, -1); 
        
LinkVehicleToInterior(bloodring_id[playerid], 15); 
        
SetVehicleVirtualWorld(bloodring_id[playerid], 15); 
        
PutPlayerInVehicle(playeridbloodring_id[playerid], 0); 
        
TogglePlayerControllable(playerid0); 
        
TimerUnfreezeAfterC SetTimerEx("unfreezeCount"1000false"ii"playerid10);  
        
SetPlayerHealth(playerid100); 
        
DerbyNumber 1
        return 
1


forward unfreezeCount(playeridtime); 
public 
unfreezeCount(playeridtime

    if((
time -= 1) > 0)
    {
        
TimerUnfreezeAfterC SetTimerEx("unfreezeCount"1000false"ii"playeridtime);
        new 
string[5]; 
        
format(stringsizeof(string), "%d"time); 
        
GameTextForPlayer(playeridstring10005); 
    }
    else
    {
        
GameTextForPlayer(playerid"GO!"25003); 
        
TogglePlayerControllable(playerid1); 
        
KillTimer(TimerUnfreezeAfterC);
    }
    return 
1

Reply
#4

NealPeteros i writed your codes don't compiled

F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6110) : error 017: undefined symbol "SendClientMessageAllEx"
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6117) : error 017: undefined symbol "SendClientMessageToAllEx"
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6124) : error 017: undefined symbol "SendClientMessageToAllEx"
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6125) : warning 217: loose indentation
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6131) : error 017: undefined symbol "SendClientMessageToAllEx"
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6132) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#5

Quote:
Originally Posted by Ramin
Посмотреть сообщение
NealPeteros i writed your codes don't compiled

F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6110) : error 017: undefined symbol "SendClientMessageAllEx"
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6117) : error 017: undefined symbol "SendClientMessageToAllEx"
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6124) : error 017: undefined symbol "SendClientMessageToAllEx"
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6125) : warning 217: loose indentation
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6131) : error 017: undefined symbol "SendClientMessageToAllEx"
F:\sa-mp 3z Alimash\IranianDeathMatch\gamemodes\DeathMatch.pwn (6132) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Erm, those are simple errors. Just replace all SendClientMessageToAllEx to SendClientMessageToAll
Reply
#6

Dayrion Your Code is very perfect but i don't want show 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
i Just want 10 Second Passd! And Then Show 3,2,1 Go

Please do changes
Reply
#7

Change this
PHP код:
forward unfreezeCount(playeridtime); 
public 
unfreezeCount(playeridtime

    if((
time -= 1) > 0)
    {
        
TimerUnfreezeAfterC SetTimerEx("unfreezeCount"1000false"ii"playeridtime);
        if(
time <= 3)
        {
            new 
string[5]; 
            
format(stringsizeof(string), "%d"time); 
            
GameTextForPlayer(playeridstring10005); 
        }
    }
    else
    {
        
GameTextForPlayer(playerid"GO!"25003); 
        
TogglePlayerControllable(playerid1); 
        
KillTimer(TimerUnfreezeAfterC);
    }
    return 
1

Reply
#8

It's Worked Thank you So Much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)