SA-MP Forums Archive
Ingame Vehicle Creator - 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: Ingame Vehicle Creator (/showthread.php?tid=352876)



Ingame Vehicle Creator - kbalor - 21.06.2012

Anyone know a filterscript that have vehicle ingame creator? a command like /createveh <id> place it somewhere. or something like that and easy to use. I search around the forum but i only found ingame object editor but they dont have vehicle editor on it.


Re: Ingame Vehicle Creator - [MM]RoXoR[FS] - 21.06.2012

Maybe if you go in Debug mode, and type /vsel you can get vehicles


Re: Ingame Vehicle Creator - Jonny5 - 21.06.2012

try this stock make any command youd like

pawn Code:
stock TryVehicleSpawn(playerid,vModel)
{
    new
        Float:X,
        Float:Y,
        Float:Z,
        Float:A,
        vehicle_id,
        col1,
        col2;

    if (!IsPlayerInAnyVehicle(playerid)){
        col1 = random(129),col2 = random(129);
        GetPlayerPos( playerid, X, Y, Z );
        GetPlayerFacingAngle(playerid, A);
        vehicle_id = CreateVehicle( vModel, X, Y, Z, A,col1,col2,0 );
        LinkVehicleToInterior(vehicle_id, GetPlayerInterior(playerid));
        PutPlayerInVehicle(playerid, vehicle_id, 0);
    }
    else
    {
        SendClientMessage(playerid,0x00FF00AA,"You're already in a vehicle.");
    }
}
this will put the player in the vehicle.

pawn Code:
//usage:

TryVehicleSpawn(playerid,401);
and heres a simple command using sscanf/zcmd.

pawn Code:
CMD:v(playerid,params[])
{
    new vModel;
    if (sscanf(params,"i",vModel)) return SendClientMessage(playerid,0x00FF00AA,"/v [ModelID]");
    if (400 > vModel > 611) return SendClientMessage(playerid,0x00FF00AA,"/v [ModelID]");
    TryVehicleSpawn(playerid,vModel);
    return 1;
}

EDIT:
and to the guy below, strtok SHOULD NEVER BE USED FOR THIS.


Re: Ingame Vehicle Creator - .-.Piero.-. - 21.06.2012

new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if (strcmp("/car", cmdtext, true, 4) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
if(!cmdtext[4])return SendClientMessage(playerid, 0xFF0000FF, "/car id");
new tmp[30];
tmp = strtok(cmdtext, idx);
new car = strval(tmp);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(car, x+1, y, z+1, 1, 0, 0, 600);
return 1;
}


Re: Ingame Vehicle Creator - mickos - 21.06.2012

Use SA-MP debug


Re: Ingame Vehicle Creator - kbalor - 21.06.2012

Quote:
Originally Posted by [MM]RoXoR[FS]
View Post
Maybe if you go in Debug mode, and type /vsel you can get vehicles
I already have a gamemode stunt so i dont want to go all over again. The problem is whenever i go to a stunt map. there is no vehicles so i just want to make a vehicles on that map.

Anyway can i use debug in gamemode im using?


Re: Ingame Vehicle Creator - kbalor - 21.06.2012

Quote:
Originally Posted by .-.Piero.-.
View Post
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if (strcmp("/car", cmdtext, true, 4) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
if(!cmdtext[4])return SendClientMessage(playerid, 0xFF0000FF, "/car id");
new tmp[30];
tmp = strtok(cmdtext, idx);
new car = strval(tmp);
new Float, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(car, x+1, y, z+1, 1, 0, 0, 600);
return 1;
}
The instruction at "0x100110ec" referenced memory 0"0x00000044" The memory could not be "read"


Re: Ingame Vehicle Creator - kbalor - 21.06.2012

Quote:
Originally Posted by Jonny5
View Post
try this stock make any command youd like

pawn Code:
stock TryVehicleSpawn(playerid,vModel)
{
    new
        Float:X,
        Float:Y,
        Float:Z,
        Float:A,
        vehicle_id,
        col1,
        col2;

    if (!IsPlayerInAnyVehicle(playerid)){
        col1 = random(129),col2 = random(129);
        GetPlayerPos( playerid, X, Y, Z );
        GetPlayerFacingAngle(playerid, A);
        vehicle_id = CreateVehicle( vModel, X, Y, Z, A,col1,col2,0 );
        LinkVehicleToInterior(vehicle_id, GetPlayerInterior(playerid));
        PutPlayerInVehicle(playerid, vehicle_id, 0);
    }
    else
    {
        SendClientMessage(playerid,0x00FF00AA,"You're already in a vehicle.");
    }
}
this will put the player in the vehicle.

pawn Code:
//usage:

TryVehicleSpawn(playerid,401);
and heres a simple command using sscanf/zcmd.

pawn Code:
CMD:v(playerid,params)
{
    new vModel;
    if (sscanf(params,"i",vModel) return SendClientMessage(playerid,0x00FF00AA,"/v [ModelID]");
    if (400 > vModel > 611) return SendClientMessage(playerid,0x00FF00AA,"/v [ModelID]");
    TryVehicleSpawn(playerid,vModel);
    return 1;
}

EDIT:
and to the guy below, strtok SHOULD NEVER BE USED FOR THIS.
OMG! Bro can you send me a complete pwn of this?? i think your work will gonna work


Re: Ingame Vehicle Creator - .-.Piero.-. - 21.06.2012

Quote:
Originally Posted by kbalor
View Post
The instruction at "0x100110ec" referenced memory 0"0x00000044" The memory could not be "read"
#include "../include/gl_common.inc"


Re: Ingame Vehicle Creator - kbalor - 21.06.2012

Quote:
Originally Posted by mickos0087
View Post
Use SA-MP debug
Im using someones gamemode do you think its possible to use debug?