SA-MP Forums Archive
Ramp In my server - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Ramp In my server (/showthread.php?tid=249590)



Ramp In my server - IvancheBG - 19.04.2011

Hi How to add a ramp in my server.I want to spawn it with left button of the mouse and to be invissible just the player to see it.How to do that?


Re: Ramp In my server - aircombat - 19.04.2011

i already answered that with :
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/CreateObject
https://sampwiki.blast.hk/wiki/GetPlayerPos


Re: Ramp In my server - IvancheBG - 19.04.2011

yes but how to do it i dont understand in the wiki beacuse i Am a little noob


Re: Ramp In my server - [DJ]Boki - 19.04.2011

well,you're noob,that explain all...we already shows you how WIKI can help,so do not post double topics


Re: Ramp In my server - IvancheBG - 19.04.2011

OK sorry


Re: Ramp In my server - Stigg - 19.04.2011

Quote:
Originally Posted by [DJ]Boki
Посмотреть сообщение
well,you're noob,that explain all...we already shows you how WIKI can help,so do not post double topics
We all have to start somewhere. Give the guy a break.

Ivan m8, check your pm.


Re: Ramp In my server - (SF)Noobanatior - 19.04.2011

here is my one hope this helps you figure it out
pawn Код:
#if defined _ramp_included
#endinput
#endif

#define _ramp_included
#pragma library ramp


static Pressedkey[MAX_PLAYERS] = {false, ...};
new jumped[MAX_PLAYERS] = {-1, ...};
static ramped[MAX_PLAYERS];
static noramp[MAX_PLAYERS];
forward Keys();
forward DeleteRamp(playerid);
forward RampCommandText(playerid, cmdtext[]);

public RampCommandText(playerid, cmdtext[]){
    if (strcmp("/ramphelp ", cmdtext, true, 9) == 0)    {
        SendClientMessage(playerid, COLOUR_GOOD, "Type /rampon to turn ramp spawning on.");
        SendClientMessage(playerid, COLOUR_GOOD, "Type /rampoff to turn ramp spawning off.");
        SendClientMessage(playerid, COLOUR_GOOD, "Press the [Fire] button whilst in a vehicle to spawn a ramp.");
        SendClientMessage(playerid, COLOUR_BAD, "--:Credits:= Lordy [FS creator]:--");
        return 1;
    }
    if (strcmp("/rampoff ", cmdtext, true, 8) == 0) {
        ramped[playerid] = 1;
        noramp[playerid] = 1;
        SendClientMessage(playerid, COLOUR_BAD, "Type /rampon to turn it back on!");
        return 1;
    }
    if (strcmp("/rampon ", cmdtext, true, 7) == 0)  {
        ramped[playerid] = 0;
        noramp[playerid] = 0;
        SendClientMessage(playerid, COLOUR_BAD, "Type /rampoff to turn it back off!");
        return 1;
    }
    return 0;
}

public Keys(){
    new keys, jump, updown, playerid;
    new Float:x, Float:y, Float:z, Float:angle;
    for (playerid = 0; playerid < MAX_PLAYERS; playerid++) {
        if (IsPlayerConnected(playerid)) {
            GetPlayerKeys(playerid, keys, jump, updown);
            if(ramped[playerid] == 1 && noramp[playerid] == 1)  {
            if(keys & KEY_FIRE && IsCarRampable(playerid))  {
                        SendClientMessage(playerid, COLOUR_BAD, "You have Ramping turned off!");
                        SendClientMessage(playerid, COLOUR_BAD, "Type /rampon to turn it back on!");
                }
            }
            else if(ramped[playerid] == 1)  {
           
            }
            else if (keys & KEY_FIRE && IsPlayerInCar(playerid)) {{
                        GetPlayerPos(playerid, x, y, z);
                        angle = GetPosInFrontOfPlayer(playerid, x, y, GetRampDistance(playerid));
                        jumped[playerid] = CreateObject(1632, x, y, z - 0.5, 0.0, 0.0, angle);
                        ramped[playerid] = 1;
                        SetTimerEx("DeleteRamp", 800, 0, "d", playerid);
                    }
                }
            } else Pressedkey[playerid] = false;
        }
}

public DeleteRamp(playerid){
    if (jumped[playerid] != -1) {
        DestroyObject(jumped[playerid]);
        jumped[playerid] = -1;
        ramped[playerid]=0;
    }
}



#endinput
just ask if you have questions about it