Ramp In my server
#1

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?
Reply
#2

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

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

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

OK sorry
Reply
#6

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.
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)