SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 14/03/2014, 04:51 PM   #41
thundercraft
Little Clucker
 
Join Date: Mar 2014
Posts: 4
Reputation: 0
Default Re: Vehicle Spawn /V Carname|Carid Color1 Color2

Hi guys,
I'am a noob and don't now where I must place that file?
In my plugin map?
thundercraft is offline   Reply With Quote
Old 05/06/2014, 08:18 AM   #42
AiRaLoKa
Huge Clucker
 
AiRaLoKa's Avatar
 
Join Date: Aug 2013
Location: Indonesia! Nickname: [MP]AiRa_
Posts: 404
Reputation: 27
Default Re: Vehicle Spawn /V Carname|Carid Color1 Color2

Quote:
Originally Posted by thundercraft View Post
Hi guys,
I'am a noob and don't now where I must place that file?
In my plugin map?
just place it you your server directory > filterscripts.
__________________
sorry for my fucking bad english... becouse i'm Indonesian!
~~> Find all threads started by AiRaLoKa <~~

AiRaLoKa is offline   Reply With Quote
Old 05/06/2014, 08:53 AM   #43
iRaiDeN
Gangsta
 
iRaiDeN's Avatar
 
Join Date: Mar 2014
Location: Israel
Posts: 491
Reputation: 41
Default Re: Vehicle Spawn /V Carname|Carid Color1 Color2

Very nice.
iRaiDeN is offline   Reply With Quote
Old 05/06/2014, 12:39 PM   #44
HeLiOn_PrImE
High-roller
 
HeLiOn_PrImE's Avatar
 
Join Date: Jul 2010
Location: Cluj Napoca, Romania
Posts: 2,984
Reputation: 435
Default Re: Vehicle Spawn /V Carname|Carid Color1 Color2

It works fine, but I do have a question. How can I display the name of the car that I just spawned?
__________________

"It's only a game, but people are real. You have to respect them." - Mick88
"You don't deserve a +rep, if you ask for it. Those who deserve it, don't have to ask." - me

HeLiOn_PrImE is offline   Reply With Quote
Old 05/06/2014, 12:46 PM   #45
AiRaLoKa
Huge Clucker
 
AiRaLoKa's Avatar
 
Join Date: Aug 2013
Location: Indonesia! Nickname: [MP]AiRa_
Posts: 404
Reputation: 27
Default Re: Vehicle Spawn /V Carname|Carid Color1 Color2

Quote:
Originally Posted by HeLiOn_PrImE View Post
It works fine, but I do have a question. How can I display the name of the car that I just spawned?
maybe this will help you

Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
	{
		new str[32];
		if (newstate == 2 || newstate == 3)
		{
 			format(str, sizeof(str), "~g~~h~%s",VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
 			GameTextForPlayer(playerid, str, 1500, 1);
		}
 	}
	return 1;
}
__________________
sorry for my fucking bad english... becouse i'm Indonesian!
~~> Find all threads started by AiRaLoKa <~~

AiRaLoKa is offline   Reply With Quote
Old 05/06/2014, 11:08 PM   #46
TheBetaFox
Huge Clucker
 
TheBetaFox's Avatar
 
Join Date: Jan 2011
Location: Nowhere.
Posts: 256
Reputation: 92
Default Re: Vehicle Spawn /V Carname|Carid Color1 Color2

OP, you could try the custom vehicle specifier built-in the sscanf include as an example: it'll shorten your code a lot. Think something like this:

Code:
new pVeh[MAX_PLAYERS];

CMD:v(playerid, params[]) {
	new modelid, color[2], fPos[4];
	if(sscanf(params, "k<vehicle>D(1)D(1)", modelid, color[0], color[1]))
		return SendClientMessage(playerid, -1, "USAGE: /v <vehicle id/name> <optional: color1> <optional: color2>");
	if(pVeh[playerid]) DestroyVehicle(pVeh[playerid]);
		
	GetPlayerPos(playerid, fPos[0], fPos[1], fPos[2]);
	GetPlayerFacingAngle(playerid, fPos[3]);
	
	pVeh[playerid] = CreateVehicle(playerid, fPos[0], fPos[1], fPos[2], fPos[3], color[0], color[1], 0);
	LinkVehicleToInterior(pVeh[playerid], GetPlayerInterior(playerid));
	PutPlayerInVehicle(playerid, pVeh[playerid], 0);
	return true;
}

See the code of the vehicle specifier in sscanf.inc to see how it works and you'll soon be on... well, not necessarily the right track, but most certainly an easier one.
__________________
Looking to work on something.
Send me a PM if you wish to talk to me privately,
as I will not respond to visitor messages.
TheBetaFox is offline   Reply With Quote
Old 08/11/2014, 08:33 PM   #47
ItzRbj
Banned
 
Join Date: Mar 2014
Location: Somewhere
Posts: 119
Reputation: 12
Default Re: Vehicle Spawn /V Carname|Carid Color1 Color2

i placed the file in filterscripts and added cs in the server.cfg but when i enter the server it doesnt work , any help ?
ItzRbj is offline   Reply With Quote
Old 11/12/2014, 01:42 PM   #48
dan40o
Big Clucker
 
Join Date: Oct 2009
Posts: 151
Reputation: 2
Default Re: Vehicle Spawn /V Carname|Carid Color1 Color2

it's Bugged. Somethimes when i wanna spawn car, it disappear.
dan40o is offline   Reply With Quote
Old 12/05/2018, 08:49 PM   #49
SeeD
Little Clucker
 
Join Date: Dec 2016
Posts: 4
Reputation: 0
Default Re: Vehicle Spawn /V Carname|Carid Color1 Color2

Nice job.
SeeD is offline   Reply With Quote
Old 13/05/2018, 09:48 AM   #50
MikeC1
Little Clucker
 
MikeC1's Avatar
 
Join Date: Apr 2018
Posts: 18
Reputation: 2
Default Re: Vehicle Spawn /V Carname|Carid Color1 Color2

Thank you dube .
__________________
MikeC1 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] GTA's Vehicle Spawns (1040 vehicle spawn locations) Slice Filterscripts 47 03/04/2018 01:15 AM
/veh IDcar color1 color2 morovicborna Help Archive 5 23/06/2010 06:59 PM
/v buy [ModelID] [Color1] [Color2] [NYRP]Mike. Help Archive 2 07/05/2010 12:13 AM
How to spawn inside vehicle using cmdtext!, then deleting vehicle after spawn??! DualDier12 Help Archive 17 20/10/2009 02:42 AM
I need /veh CarID color1 color2 command! JPonsen Help Archive 7 27/08/2009 02:49 PM


All times are GMT. The time now is 09:48 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.