#1

I put myself Event StuntNRG and I have a problem.
Event starts say 10 minutes and. Problem is that it does not start, but I put Settimer.
Help me ?




pawn Код:
//NRG
new Float:NRGStuntX;
new Float:NRGStuntY;
new Float:NRGStuntZ;
new NRGStarted;
new IsAtStuntEvent[MAX_PLAYERS];
new Float:NRGStunt[][3] =
{
    {1005.3336,-935.8200,47.7870},
    {1206.0599,-1791.2509,33.2594},
    {2170.7207,2230.1675,24.5135},
    {1959.7527,1948.9136,22.7932},
    {1419.0551,-1008.9674,46.5068},
    {1494.8749,-676.1847,105.7233},
    {1829.6609,-1412.6492,29.1925}
};


forward StartNewNRGEvent();
public StartNewNRGEvent()
{
    NRGStarted = 1;
    new str[128];
    new rand = random(sizeof(NRGStunt));
    CashboxValue = MinCashboxValue+random(MaxCashboxValue-MinCashboxValue);
    CreatePickup(1210, 3, NRGStunt[rand][0], NRGStunt[rand][1], NRGStunt[rand][2],-999);
    NRGStuntX = NRGStunt[rand][0];
    NRGStuntY = NRGStunt[rand][1];
    NRGStuntZ = NRGStunt[rand][2];
    format(str, 128, "{D40000}Stunt event {FFFFFF}a inceput,intra la event,ajungi la checkpoint si castigi {FF9900}$%d.", CashboxValue);
    SendClientMessageToAll(COLOR_WHITE, str);
    SendClientMessageToAll(COLOR_WHITE, "Foloseste {D40000}/stuntevent{FFFFFF} pentru a intra la event!");
    SendClientMessageToAll(COLOR_WHITE, "Aveti la dispozitie {FF9900}15 minute{FFFFFF} sa ajungeti la checkpoint.");
    //SetTimer("EndNRGEvent", 6000000, 0);
}
forward EndNRGEvent();
public EndNRGEvent()
{
    if(NRGStarted == 1)
    {
       NRGStarted = 0;
       new str[128];
       format(str, 128, "Nimeni nu a ajuns la checkpoint-ul de la {FF9900}stunt event!", CashboxValue);
       SendClientMessageToAll(COLOR_WHITE, str);
       SendClientMessageToAll(COLOR_WHITE, "Un nou event va incepe in {FFFFFF}60 minute.");
    }
    else if(NRGStarted == 0)
    {
       return 1;
    }
    return 0;
}



else if(IsAtStuntEvent[playerid] == 1 && NRGStarted == 1)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
        new str[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, sizeof(pName));
        format(str, 128, "{33FF33}%s (ID: %d) {FFFFFF}a ajuns la checkpoint-ul de la {FF9900}stunt event{FFFFFF},acesta a castigat {FF9900}$%d", pName, playerid, CashboxValue);
        SendClientMessageToAll(COLOR_WHITE, str);
        SendClientMessageToAll(COLOR_WHITE, "Un nou stunt event va incepe in {00E000}10 minute.");
        GivePlayerMoney(playerid, CashboxValue);
        format(str, 128, "~y~Felicitari! ~n~~r~ Ai castigat ~n~~g~$%d", CashboxValue);
        GameTextForPlayer(playerid, str, 4000, 3);
        IsAtStuntEvent[playerid] = 0;
        DisablePlayerCheckpoint(playerid);
        NRGStarted = 0;
        SetTimer("StartNRGStunt", 100000, 0);
        }
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
           if(IsAtStuntEvent[i] == 1)
           {
              DisablePlayerCheckpoint(i);
              return 1;
           }
        }
    }




if(strcmp(cmd,"/stuntevent",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
           if(NRGStarted == 0)
           {
               SendClientMessage(playerid, COLOR_LIGHTBLUE,"This event isn't started at the moment!");
               return 1;
           }
           if(PlayerOnMission[playerid] > 0)
           {
                        SendClientMessage(playerid, COLOR_GREY, " You're on mission right now,you can't hold any Materials Packages!");
                        return 1;
           }
           SetPlayerCheckpoint(playerid, NRGStuntX,NRGStuntY,NRGStuntZ, 3.0);
           IsAtStuntEvent[playerid] = 1;
           SendClientMessage(playerid, COLOR_LIGHTBLUE, "{FFFFFF}••• Ai intrat la {FF9900}StuntEVENT. {FFFFFF}Du-te la checkpoint si fa {FF9900}stunt-ul!");
           return 1;
        }
    }
    if(strcmp(cmd,"/startstuntevent",true)==0)
    {
        if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pAdmin] >= 1337)
        {
           StartNewNRGEvent();
           return 1;
        }
    }
    if(strcmp(cmd,"/stopstuntevent",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {

           IsAtStuntEvent[playerid] = 0;
           SendClientMessage(playerid, COLOR_GREY, "Ai oprit {FF9900}StuntEvent-ul!");
           return 1;
        }
    }
Reply
#2

pawn Код:
StartNewNRGEvent()
it has to be
pawn Код:
SetTimer("StartNewNRGEvent",intervalhere,false)
you were just writing down the name of the timer,but not using the actual function
Reply
#3

pawn Код:
C:\Documents and Settings\Madalin\Desktop\GM\gamemodes\Godfather.pwn(10235) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Madalin\Desktop\GM\gamemodes\Godfather.pwn(10235) : error 076: syntax error in the expression, or invalid function call
C:\Documents and Settings\Madalin\Desktop\GM\gamemodes\Godfather.pwn(10235) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Madalin\Desktop\GM\gamemodes\Godfather.pwn(10235) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


10235     SetTimer("StartNewNRGEvent,10,false)
Reply
#4

terminate the string.
you must add another " behind the StartNewNRGEvent
Reply
#5

I already have the function:

pawn Код:
forward StartNewNRGEvent();
Reply
#6

Quote:
Originally Posted by Madalyinn
Посмотреть сообщение
I already have the function:

pawn Код:
forward StartNewNRGEvent();
10235 SetTimer("StartNewNRGEvent,10,false)
On line 10235 change it from
pawn Код:
SetTimer("StartNewNRGEvent,10,false) // You forgot the " on the "StartNewNRGEvent"
to
pawn Код:
SetTimer("StartNewNRGEvent",10,false)
Reply
#7

Please keep in mind that the seconds are counted in milliseconds and not actual seconds. Use 10000 if you want 10 seconds.
Reply
#8

thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)