SA-MP Forums Archive
[Help ME] Help with vehicles /enter and /exit. - 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 ME] Help with vehicles /enter and /exit. (/showthread.php?tid=301865)



[Help ME] Help with vehicles /enter and /exit. - umarmalik - 06.12.2011

Hello.

I need the help in making vehicle /enter or /exit system. lets suppose that there is a wall and I want a /enter and /exit system between them. How to create the script in which we make vehicles or people /enter, /exit system.

I appreciate Your Help.


Re: [Help ME] Help with vehicles /enter and /exit. - Scones - 06.12.2011

Can you specify a little better?


Re: [Help ME] Help with vehicles /enter and /exit. - umarmalik - 06.12.2011

sorry for my bad english.

I need a system of vehicle enter or exit system. lets suppose we make a garage underground but the gate is not openable, I need to take my vehicle in the garage by system of enter/exit. same the system that we enter in house and any biz by using /enter command and exit by /exit command. but i need vehicle enter and exit command by using coordinates .


Re: [Help ME] Help with vehicles /enter and /exit. - [C]ave[M]an - 06.12.2011

Get the entrance coordinates and the exit coordinates. Use
pawn Код:
IsPlayerInRangeOfPoint
so that you cannot /enter at any place


Re: [Help ME] Help with vehicles /enter and /exit. - Kostas' - 06.12.2011

pawn Код:
// In ZCMD:
CMD:enter(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0) {
        SetPlayerPos(playerid, X, Y, Z); // Coordinates from enter..
    else {
        SendClientMessage(playerid, -1, "You need to be driver to enter ...");
    }
    return 1;
}
CMD:exit(playerid, params[])
{
    SetPlayerPos(playerid, X, Y, Z); // Coordinates from exit..
    return 1;
}

================================================================================

// In Strcmp:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/enter", true)) {
        if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0) {
            SetPlayerPos(playerid, X, Y, Z); // Coordinates from enter..
        else {
            SendClientMessage(playerid, -1, "You need to be driver to enter ...");
        }
        return 1;
    }
    if(!strcmp(cmdtext, "/exit", true)) {
        SetPlayerPos(playerid, X, Y, Z); // Coordinates from exit..
        return 1;
    }
    // Rest Of Code
    return 0;
}



Re: [Help ME] Help with vehicles /enter and /exit. - umarmalik - 06.12.2011

Thank you Friends!

I appreciate your help and 1 rep for each to help me.


Re: [Help ME] Help with vehicles /enter and /exit. - SupremeCommander - 06.12.2011

<Deleted since the solution has already been provided.>