SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 12/03/2010, 03:09 PM   #1
biltong
Gangsta
 
Join Date: Jan 2010
Posts: 546
Reputation: 0
Default [FS]Vehicle Names v1.1.1

VEHICLE NAMES
by biltong
v1.1.1

Since 0.3 Vehicle names no longer appear when you get into one. This is a simple filterscript that replaces that system, and works in 0.3.

This is my first filterscript so please report any bugs and suggestions here.

Changelog:
1.0:
  • Initial Release
1.1
  • You can now change the colour of the text by changing GAMETEXT_COLOR at the top of the script to the number corresponding to the colour you want. 0= yellow, 1 = blue, 2 = green, 3 = red, 4 = purple, 5 = white, 6 = black.
  • Fixed the changing vehicles bug
1.1.1
  • Minor update, code optimization

KNOWN BUGS:
  • If a player is in a vehicle and is suddenly put into another vehicle, the name won't appear.
  • With 1.1.1, when the server is started it will show "Loaded Vehicle Names v1.1", not 1.1.1. I forgot to change that, 1.1.1 is 1.1.1

DOWNLOAD:
1.1.1:

Pastebin

If all else fails see attachments.

INSTALLATION:
The .rar: Open the file with Winrar and extract the files in there to your server's filterscripts folder. Then open your server.cfg file and add "vehiclenames" to the filterscripts line. Start up your server and look at the pretty text :3
Via Pastebin: Follow the link and scroll down to the bottom. Copy all text in the box there. Now open Pawno, paste the text into Pawno and compile it as "vehiclenames". Now open your server.cfg and add "vehiclenames"(or, if you changed the name of the file, replace "vehiclenames" with whatever you saved the file as) to the filterscripts line, start your server and enjoy

SCREENIES:




What's next?
Nothing as of yet. Suggestions please!
__________________
My releases:
[FS]Admin Click - An admin shortcut script. Lots of commands like kick and ban in a few mouse clicks!
[FS]Vehicle Names - Simple script that displays your vehicle's name whenever you enter one.
[GM]Cops 'n Criminals - An unusual TDM.


Not active anymore, PM me if necessary.
biltong is offline   Reply With Quote
Old 12/03/2010, 03:42 PM   #2
JPs_
Big Clucker
 
Join Date: Feb 2010
Posts: 82
Reputation: 0
Default Re: [FS]Vehicle Names

nice
JPs_ is offline   Reply With Quote
Old 12/03/2010, 04:24 PM   #3
Joe Staff
High-roller
 
Join Date: Aug 2007
Posts: 2,593
Reputation: 379
Default Re: [FS]Vehicle Names

You should use
pawn Code:
if((newstate==PLAYER_STATE_DRIVER)||(newstate==PLAYER_STATE_PASSENGER))
  {
    GameTextForPlayer(playerid,VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400],6000,1);
    return 1;
  }
instead of
pawn Code:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  {
    new vehicleid = GetPlayerVehicleID(playerid);
    new model = (GetVehicleModel(vehicleid))-400;
    new string[32];
    format(string,sizeof(string),"%s",VehicleNames[model]);
    GameTextForPlayer(playerid,string,6000,1);
    return 1;
  }
So it runs faster and more efficiently.
Joe Staff is offline   Reply With Quote
Old 12/03/2010, 06:24 PM   #4
biltong
Gangsta
 
Join Date: Jan 2010
Posts: 546
Reputation: 0
Default Re: [FS]Vehicle Names

Quote:
Originally Posted by Joe Staff
You should use
pawn Code:
if((newstate==PLAYER_STATE_DRIVER)||(newstate==PLAYER_STATE_PASSENGER))
  {
    GameTextForPlayer(playerid,VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400],6000,1);
    return 1;
  }
instead of
pawn Code:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  {
    new vehicleid = GetPlayerVehicleID(playerid);
    new model = (GetVehicleModel(vehicleid))-400;
    new string[32];
    format(string,sizeof(string),"%s",VehicleNames[model]);
    GameTextForPlayer(playerid,string,6000,1);
    return 1;
  }
So it runs faster and more efficiently.
Thanks! I'll fix that, and I just thought of a few things to add too. Though, I question the amount of CPU this will take. It's a very small piece of code.

Gonna wait a bit then release new version. Hopefully I'll get the changing vehicles bug sorted by then.
__________________
My releases:
[FS]Admin Click - An admin shortcut script. Lots of commands like kick and ban in a few mouse clicks!
[FS]Vehicle Names - Simple script that displays your vehicle's name whenever you enter one.
[GM]Cops 'n Criminals - An unusual TDM.


Not active anymore, PM me if necessary.
biltong is offline   Reply With Quote
Old 12/03/2010, 06:35 PM   #5
Lejo
Big Clucker
 
Join Date: Jan 2010
Posts: 136
Reputation: 0
Default Re: [FS]Vehicle Names

Simple but nice.
Lejo is offline   Reply With Quote
Old 14/03/2010, 03:26 PM   #6
biltong
Gangsta
 
Join Date: Jan 2010
Posts: 546
Reputation: 0
Default Re: [FS]Vehicle Names v1.1 RELEASED

Version 1.1 released!

You can now change the color of the text by opening the script and changing the number after
pawn Code:
#define GAMETEXT_COLOR

0(default) = yellow
1 = blue
2 = green
3 = red
4 = purple
5 = white
6 = black

I also fixed the changing vehicles bug. Please keep the feedback coming guys
Enjoy
__________________
My releases:
[FS]Admin Click - An admin shortcut script. Lots of commands like kick and ban in a few mouse clicks!
[FS]Vehicle Names - Simple script that displays your vehicle's name whenever you enter one.
[GM]Cops 'n Criminals - An unusual TDM.


Not active anymore, PM me if necessary.
biltong is offline   Reply With Quote
Old 14/03/2010, 03:28 PM   #7
XRVX
High-roller
 
Join Date: Aug 2009
Posts: 1,141
Reputation: 9
Default Re: [FS]Vehicle Names v1.1 RELEASED

looks good
nice work
XRVX is offline   Reply With Quote
Old 16/03/2010, 12:43 PM   #8
Las Venturas CNR
Gangsta
 
Join Date: Feb 2010
Posts: 535
Reputation: 42
Default Re: [FS]Vehicle Names v1.1 RELEASED

Sweet! Can you make one of these for areas? So it says the area names?
Las Venturas CNR is offline   Reply With Quote
Old 16/03/2010, 03:07 PM   #9
Rzzr
Gangsta
 
Rzzr's Avatar
 
Join Date: Aug 2007
Location: Netherlands
Posts: 657
Reputation: 264
Default Re: [FS]Vehicle Names v1.1 RELEASED

Quote:
Originally Posted by World War III
Sweet! Can you make one of these for areas? So it says the area names?
Use search, it already exists...
http://forum.sa-mp.com/index.php?topic=44902.0
Rzzr is offline   Reply With Quote
Old 16/03/2010, 03:23 PM   #10
biltong
Gangsta
 
Join Date: Jan 2010
Posts: 546
Reputation: 0
Default Re: [FS]Vehicle Names v1.1 RELEASED

Quote:
Originally Posted by LowCo.
Actually, that is an include that only gets the name of the zone that the player is in, it doesn't display the zone. It could be used to make such a FS though. I'll look into it during my school holidays, which are 2 weeks away.

EDIT: Here is a script that shows the zone name
http://forum.sa-mp.com/index.php?topic=5311.0
__________________
My releases:
[FS]Admin Click - An admin shortcut script. Lots of commands like kick and ban in a few mouse clicks!
[FS]Vehicle Names - Simple script that displays your vehicle's name whenever you enter one.
[GM]Cops 'n Criminals - An unusual TDM.


Not active anymore, PM me if necessary.
biltong 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
Vehicle Names M1K1 Help Archive 3 30/12/2009 04:15 PM
[Include] [INC]Vehicle names instead of IDs XtremeChio Includes 17 20/09/2009 02:41 PM
[NEED HELP] vehicle names Drift_King786 Help Archive 7 27/05/2009 01:33 PM
Vehicle names darkrider366 Help Archive 1 03/02/2009 01:45 PM


All times are GMT. The time now is 10:55 PM.


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