SA-MP Forums Archive
Help Plz!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help Plz!! (/showthread.php?tid=489893)



Help Plz!! - AbdouGh - 24.01.2014

Hi, how to use this https://sampwiki.blast.hk/wiki/TextDrawCreate and this https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
to make Tuning car checkpoint?
like this:
http://im31.gulfup.com/v3ED4.png
http://im31.gulfup.com/dFQTo.png
http://im31.gulfup.com/rP0Sx.png
http://im31.gulfup.com/v5D9r.png


Re: Help Plz!! - AbdouGh - 24.01.2014

can someone help me?? plz


Re: Help Plz!! - AbdouGh - 24.01.2014

any one??


Re : Help Plz!! - AbdouGh - 24.01.2014

please i need this


Re: Help Plz!! - Shetch - 24.01.2014

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.