Help Plz!!
#5

Look at the wiki pages. It clearly shows how to create checkpoints.

Код:
new Text:upgrade_text_draw;
new bool:can_upgrade[MAX_PLAYERS];

public OnGameModeInit()
{
    upgrade_text_draw = TextDrawCreate(240.0,580.0,"Press space to repair your vehicle.");
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    TextDrawShowForPlayer(playerid, upgrade_text_draw);
    can_upgrade[playerid] = true;
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    TextDrawHideForPlayer(playerid, upgrade_text_draw);
    can_upgrade[playerid] = false;
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_JUMP))
    {
        if(can_upgrade[playerid] == true)
        {
            SetPlayerVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
        }
    }
return 1;
}
This code is not tested and may contain bugs, since I wrote it right here on the forums.
Reply


Messages In This Thread
Help Plz!! - by AbdouGh - 24.01.2014, 15:38
Re: Help Plz!! - by AbdouGh - 24.01.2014, 16:37
Re: Help Plz!! - by AbdouGh - 24.01.2014, 18:04
Re : Help Plz!! - by AbdouGh - 24.01.2014, 19:56
Re: Help Plz!! - by Shetch - 24.01.2014, 20:06

Forum Jump:


Users browsing this thread: 2 Guest(s)