SetTimerEx
#5

pawn Код:
new WelcomeTimerEx[MP];

public WelcomeTimer(playerid)
{
    print("1");
    new string[126];
    print("2");
    TextDrawHideForPlayer(playerid, WelcomeScreen0);
    print("3");
    TextDrawHideForPlayer(playerid, WelcomeScreen1);
    print("4");
    TextDrawHideForPlayer(playerid, WelcomeScreen2);
    print("5");
    TextDrawHideForPlayer(playerid, WelcomeScreen3);
    print("6");

    SetPlayerPos(playerid, -2089.1033, 2314.7834, 15.2437);
    SetPlayerCameraPos(playerid, -2085.851562, 2313.926513, 27.484699);
    SetPlayerCameraLookAt(playerid, -2090.496826, 2315.150634, 26.098077);

    TogglePlayerControllable(playerid, 0);

    format(string, sizeof(string), "{FFFFFF}You've connected to {33818E}Suburban Roleplay!");
    SendClientMessage(playerid, -1, string);

    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        if(PlayerData[playerid][Registered] == 0) /* Register Player */
        {
            ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "{FFFFFF}Register on Suburban Roleplay", "{FFFFFF}Welcome to Suburban Roleplay.\n\nYour account doesn't exist in our database. Please input a desired password below.", "Continue", "Quit");
        }
        else if(PlayerData[playerid][Registered] == 1) /* Login Player */
        {
            format(string, sizeof(string), "{FFFFFF}Welcome back, %s.\n\nPlease input your existing password below.", GetPlayersName(playerid));
            ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FFFFFF}Log back into Suburban Roleplay", string, "Login", "Leave");
        }
    }
    else /* Register Player */
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "{FFFFFF}Register on Suburban Roleplay", "{FFFFFF}Welcome to Suburban Roleplay.\n\nYour account doesn't exist in our database. Please input a desired password below.", "Continue", "Quit");
    }
    KillTimer(WelcomeTimerEx[playerid]);
    return 1;
}

    if(gIsPlayerLoggedIn[playerid] == 0)
    {
        ClearScreen(playerid);
        TextDrawShowForPlayer(playerid, WelcomeScreen0);
        TextDrawShowForPlayer(playerid, WelcomeScreen1);
        TextDrawShowForPlayer(playerid, WelcomeScreen2);
        TextDrawShowForPlayer(playerid, WelcomeScreen3);
        print("before settimer");
        WelcomeTimerEx[playerid] = SetTimerEx("WelcomeTimer", 2500, false, "i", playerid);
        print("after settimer");
    }


public OnPlayerConnect(playerid)
{
    new string[126];
    gIsPlayerConnected[playerid] = 1;
    gIsPlayerLoggedIn[playerid] = 0;
    gIsPlayerSpawned[playerid] = 0;

    PlayerData[playerid][Registered] = 0;
    PlayerData[playerid][Age] = 0;
    PlayerData[playerid][Gender] = 0;
    PlayerData[playerid][Interior] = 0;
    PlayerData[playerid][VirtualWorld] = 0;
    PlayerData[playerid][Wallet] = 0;
    PlayerData[playerid][Bank] = 0;
    PlayerData[playerid][BankPin] = 0;
    PlayerData[playerid][Skin] = 0;
    PlayerData[playerid][AdminLevel] = 0;
    PlayerData[playerid][AdminKey] = 0;
    PlayerData[playerid][Dead] = 0;
    PlayerData[playerid][HospitalTime] = 0;
   
    format(string, sizeof(string), "None");
    strmid(PlayerData[playerid][LastKickedBy], string, 0, strlen(string), 255);
    strmid(PlayerData[playerid][LastKickReason], string, 0, strlen(string), 255);
    strmid(PlayerData[playerid][BannedBy], string, 0, strlen(string), 255);
    strmid(PlayerData[playerid][BanReason], string, 0, strlen(string), 255);
    strmid(PlayerData[playerid][Accent], string, 0, strlen(string), 255);
   
    HospitalTimerEx[playerid] = 0;
    WelcomeTimerEx[playerid] = 0;

    AdminCmdTimer[playerid] = 0;
    SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
    SpawnPlayer(playerid);
    return 1;
}
That's everything that involves the timer.
Reply


Messages In This Thread
SetTimerEx - by Jack_Leslie - 21.08.2012, 04:47
Re: SetTimerEx - by MP2 - 21.08.2012, 04:52
Re: SetTimerEx - by Jack_Leslie - 21.08.2012, 04:55
Re: SetTimerEx - by MP2 - 21.08.2012, 04:59
Re: SetTimerEx - by Jack_Leslie - 21.08.2012, 05:01
Re: SetTimerEx - by MP2 - 21.08.2012, 05:09
Re: SetTimerEx - by Jack_Leslie - 21.08.2012, 05:12
Re: SetTimerEx - by Jack_Leslie - 23.08.2012, 05:13

Forum Jump:


Users browsing this thread: 4 Guest(s)