SA-MP Forums Archive
Enter vehicle problem - 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: Enter vehicle problem (/showthread.php?tid=501895)



Enter vehicle problem - ChromeMenu - 21.03.2014

How would I go about making it so I can enter a certain vehicle ID?

Код:
command(entervan, playerid, params[])
{
    new name[256], string[256], Float:x, Float:y, Float:z;
    format(name, sizeof(name), "Harry_Brown");
    new id = GetPlayerID(name);
    GetVehiclePos(Player[id][Car2LinkID], x, y, z);
    if(IsPlayerInRangeOfPoint(playerid, 5, x, y, z))
    {
        format(string, sizeof(string), "* %s opens the door of the Journey, and enters it.", GetName(playerid));
        NearByMessage(playerid, PURPLE, string);
        SetPlayerPos(playerid, 2513.4495,-1729.1093,778.6371);
    }
    return 1;
}

command(exitvan, playerid, params[])
{
    new name[256], string[256], Float:x, Float:y, Float:z;
    format(name, sizeof(name), "Harry_Brown");
    new id = GetPlayerID(name);
    if(IsPlayerInRangeOfPoint(playerid, 5, 2513.4495,-1729.1093,778.6371 ))
    {
        format(string, sizeof(string), "* %s opens the door of the Journey, leaving it.", GetName(playerid));
        NearByMessage(playerid, PURPLE, string);
        GetVehiclePos(Player[id][Car2LinkID], x, y, z);
        SetPlayerPos(playerid, x-2, y, z);
    }
    return 1;
}



Re: Enter vehicle problem - blackwave - 21.03.2014

Код:
new v = GetVehicleModel(GetPlayerVehicleID(playerid));  if(v == CERTAIN_ID) { //... }