How to add this FS to GM? -
Dragony92 - 11.04.2011
How to add this FS to GM?
http://pastebin.com/1BdPR9XS
Thank you!
Re: How to add this FS to GM? -
Stigg - 11.04.2011
Quote:
Originally Posted by Dragony92
|
Copy and paste.
Re: How to add this FS to GM? -
Dragony92 - 11.04.2011
Quote:
Originally Posted by Stigg
Copy and paste.
|

?
I want to add that to gamemod....i dont want to put FS...
Re: How to add this FS to GM? -
tanush - 11.04.2011
put
pawn Код:
forward CheckStatus();
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
new PlayerVehicle[212][] = {
"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana",
"Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat",
"Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife",
"Trailer 1", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo",
"Seasparrow", "Pizzaboy", "Tram", "Trailer 2", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair",
"Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic", "Sanchez", "Sparrow",
"Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito",
"Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring",
"Sandking", "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B",
"Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster","Stunt", "Tanker",
"Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
"Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak",
"Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck LA", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit",
"Utility", "Nevada", "Yosemite", "Windsor", "Monster A", "Monster B", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance",
"RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway",
"Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer 3", "Emperor", "Wayfarer", "Euros", "Hotdog",
"Club", "Freight Carriage", "Trailer 4", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", "Police Car (SFPD)",
"Police Car (LVPD)", "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer A",
"Luggage Trailer B", "Stairs", "Boxville", "Tiller", "Utility Trailer" };
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Booleans
new bool:TextDrawsShown[MAX_PLAYERS];
new bool:LightRedHealthCreated[MAX_PLAYERS];
new bool:LightYellowSpeedCreated[MAX_PLAYERS];
new bool:VHSCreated[MAX_PLAYERS];
new bool:ExclamationShown[MAX_PLAYERS];
//Timer
new CheckStatusTimer;
//4all
new Text:Black0;
new Text:White1;
new Text:White2;
new Text:BlackHealth;
new Text:DarkRedHealth;
new Text:BlackSpeed;
new Text:DarkYellowSpeed;
new Text:Marker;
new Text:Exclamation;
//4player
new Text:VHS[MAX_PLAYERS];
new Text:LightRedHealth[MAX_PLAYERS];
new Text:LightYellowSpeed[MAX_PLAYERS];
//Speed
new Float:OldX[MAX_PLAYERS];
new Float:OldY[MAX_PLAYERS];
new Float:OldZ[MAX_PLAYERS];
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
wayyy top,
OnGameModeInit put,
pawn Код:
Black0 = TextDrawCreate(481.000000,353.000000,"_");
TextDrawUseBox(Black0,1);
TextDrawBoxColor(Black0,0x00000044);
TextDrawTextSize(Black0,596.000000,0.000000);
TextDrawAlignment(Black0,0);
TextDrawBackgroundColor(Black0,0x000000ff);
TextDrawFont(Black0,3);
TextDrawLetterSize(Black0,3.599999,7.599996);
TextDrawColor(Black0,0xffffffff);
TextDrawSetOutline(Black0,1);
TextDrawSetProportional(Black0,1);
TextDrawSetShadow(Black0,1);
White1 = TextDrawCreate(482.000000,354.000000,"_");
TextDrawUseBox(White1,1);
TextDrawBoxColor(White1,0xffffff11);
TextDrawTextSize(White1,595.000000,-2.000000);
TextDrawAlignment(White1,0);
TextDrawBackgroundColor(White1,0x000000ff);
TextDrawFont(White1,1);
TextDrawLetterSize(White1,1.700000,7.399997);
TextDrawColor(White1,0xffffffff);
TextDrawSetOutline(White1,1);
TextDrawSetProportional(White1,1);
TextDrawSetShadow(White1,1);
White2 = TextDrawCreate(483.000000,355.000000,"_");
TextDrawUseBox(White2,1);
TextDrawBoxColor(White2,0xffffff22);
TextDrawTextSize(White2,594.000000,0.000000);
TextDrawAlignment(White2,0);
TextDrawBackgroundColor(White2,0x000000ff);
TextDrawFont(White2,1);
TextDrawLetterSize(White2,0.299999,7.199996);
TextDrawColor(White2,0xffffffff);
TextDrawSetOutline(White2,1);
TextDrawSetProportional(White2,1);
TextDrawSetShadow(White2,1);
BlackHealth = TextDrawCreate(487.000000,385.000000,"_");
TextDrawUseBox(BlackHealth,1);
TextDrawBoxColor(BlackHealth,0x00000099);
TextDrawTextSize(BlackHealth,590.000000,-11.000000);
TextDrawAlignment(BlackHealth,0);
TextDrawBackgroundColor(BlackHealth,0x000000ff);
TextDrawFont(BlackHealth,3);
TextDrawLetterSize(BlackHealth,1.000000,0.399999);
TextDrawColor(BlackHealth,0xffffffff);
TextDrawSetOutline(BlackHealth,1);
TextDrawSetProportional(BlackHealth,1);
TextDrawSetShadow(BlackHealth,1);
DarkRedHealth = TextDrawCreate(488.000000,386.000000,"_");
TextDrawUseBox(DarkRedHealth,1);
TextDrawBoxColor(DarkRedHealth,0xff000066);
TextDrawTextSize(DarkRedHealth,589.000000,0.000000);
TextDrawAlignment(DarkRedHealth,0);
TextDrawBackgroundColor(DarkRedHealth,0x000000ff);
TextDrawFont(DarkRedHealth,3);
TextDrawLetterSize(DarkRedHealth,1.000000,0.199999);
TextDrawColor(DarkRedHealth,0xffffffff);
TextDrawSetOutline(DarkRedHealth,1);
TextDrawSetProportional(DarkRedHealth,1);
TextDrawSetShadow(DarkRedHealth,1);
BlackSpeed = TextDrawCreate(536.000000,403.000000,"_");
TextDrawUseBox(BlackSpeed,1);
TextDrawBoxColor(BlackSpeed,0x00000099);
TextDrawTextSize(BlackSpeed,590.000000,0.000000);
TextDrawAlignment(BlackSpeed,0);
TextDrawBackgroundColor(BlackSpeed,0x000000ff);
TextDrawFont(BlackSpeed,3);
TextDrawLetterSize(BlackSpeed,1.000000,1.400000);
TextDrawColor(BlackSpeed,0xffffffff);
TextDrawSetOutline(BlackSpeed,1);
TextDrawSetShadow(BlackSpeed,1);
TextDrawSetProportional(BlackSpeed,1);
DarkYellowSpeed = TextDrawCreate(537.000000,404.000000,"_");
TextDrawUseBox(DarkYellowSpeed,1);
TextDrawBoxColor(DarkYellowSpeed,0xffff0033);
TextDrawTextSize(DarkYellowSpeed,589.000000,0.000000);
TextDrawAlignment(DarkYellowSpeed,0);
TextDrawBackgroundColor(DarkYellowSpeed,0x000000ff);
TextDrawFont(DarkYellowSpeed,3);
TextDrawLetterSize(DarkYellowSpeed,1.000000,1.200000);
TextDrawColor(DarkYellowSpeed,0xffffffff);
TextDrawSetOutline(DarkYellowSpeed,1);
TextDrawSetProportional(DarkYellowSpeed,1);
TextDrawSetShadow(DarkYellowSpeed,1);
Marker = TextDrawCreate(511.000000,382.000000,"l");
TextDrawAlignment(Marker,0);
TextDrawBackgroundColor(Marker,0x000000ff);
TextDrawFont(Marker,1);
TextDrawLetterSize(Marker,0.099999,1.000000);
TextDrawColor(Marker,0xffffffff);
TextDrawSetOutline(Marker,1);
TextDrawSetProportional(Marker,1);
TextDrawSetShadow(Marker,1);
Exclamation = TextDrawCreate(579.000000,351.000000,"~r~!");
TextDrawAlignment(Exclamation,0);
TextDrawBackgroundColor(Exclamation,0x000000ff);
TextDrawFont(Exclamation,2);
TextDrawLetterSize(Exclamation,1.200000,3.399999);
TextDrawColor(Exclamation,0xffffffff);
TextDrawSetOutline(Exclamation,1);
TextDrawSetProportional(Exclamation,1);
TextDrawSetShadow(Exclamation,1);
CheckStatusTimer = SetTimer("CheckStatus", 1000, 1);
OnGameModeExit put
pawn Код:
KillTimer(CheckStatusTimer);
TextDrawDestroy(Text:Black0);
TextDrawDestroy(Text:White1);
TextDrawDestroy(Text:White2);
TextDrawDestroy(Text:BlackHealth);
TextDrawDestroy(Text:DarkRedHealth);
TextDrawDestroy(Text:BlackSpeed);
TextDrawDestroy(Text:DarkYellowSpeed);
TextDrawDestroy(Text:Marker);
TextDrawDestroy(Text:Exclamation);
for(new i=0; i<MAX_PLAYERS; i++)
{
TextDrawDestroy(Text:VHS[i]);
TextDrawDestroy(Text:LightRedHealth[i]);
TextDrawDestroy(Text:LightYellowSpeed[i]);
}
OnPlayerConnect put
pawn Код:
TextDrawsShown[playerid] = false;
VHSCreated[playerid] = false;
LightRedHealthCreated[playerid] = false;
LightYellowSpeedCreated[playerid] = false;
Bottom of your script put
pawn Код:
public CheckStatus()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(TextDrawsShown[i] == false)
{
TextDrawShowForPlayer(i, Text:Black0);
TextDrawShowForPlayer(i, Text:White1);
TextDrawShowForPlayer(i, Text:White2);
TextDrawShowForPlayer(i, Text:BlackHealth);
TextDrawShowForPlayer(i, Text:DarkRedHealth);
TextDrawShowForPlayer(i, Text:BlackSpeed);
TextDrawShowForPlayer(i, Text:DarkYellowSpeed);
TextDrawShowForPlayer(i, Text:Marker);
TextDrawsShown[i] = true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
new String[128];
new Float:X, Float:Y, Float:Z, Float:Distance;
GetPlayerPos(i, X, Y, Z);
Distance = floatsqroot(floatadd(floatadd(floatpower(floatsub(X, OldX[i]), 2), floatpower(floatsub(Y, OldY[i]), 2)), floatpower(floatsub(Z, OldZ[i]), 2)));
new PlayerVehicleModelID = GetVehicleModel(GetPlayerVehicleID(i));
PlayerVehicleModelID -= 400;
format(String,sizeof(String),"~b~Vozilo:~n~~w~%s~n~~b~Ostecenost:~n~~n~Brzina:~n~~w~%im/h~n~%ikm/h", PlayerVehicle[PlayerVehicleModelID], floatround(floatmul(floatdiv(Distance, 1.609344), 2.0), floatround_floor), floatround(floatmul(Distance, 2.0), floatround_floor));
if(VHSCreated[i] == true)
{
TextDrawDestroy(VHS[i]);
}
VHS[i] = TextDrawCreate(485.000000,355.000000,String);
TextDrawAlignment(VHS[i],0);
TextDrawBackgroundColor(VHS[i],0x000000ff);
TextDrawFont(VHS[i],1);
TextDrawLetterSize(VHS[i],0.299999,1.000000);
TextDrawColor(VHS[i],0xffffffff);
TextDrawSetOutline(VHS[i],1);
TextDrawSetProportional(VHS[i],1);
TextDrawSetShadow(VHS[i],1);
TextDrawShowForPlayer(i, VHS[i]);
VHSCreated[i] = true;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
new Float:CarHealth;
GetVehicleHealth(GetPlayerVehicleID(i), CarHealth);
if(LightRedHealthCreated[i] == true)
{
TextDrawDestroy(LightRedHealth[i]);
}
LightRedHealth[i] = TextDrawCreate(488.000000,386.000000,"_");
TextDrawUseBox(LightRedHealth[i],1);
TextDrawBoxColor(LightRedHealth[i],0xff000099);
TextDrawTextSize(LightRedHealth[i], floatadd(484.0, floatdiv(CarHealth, 9.5238095238)),0.000000);
TextDrawAlignment(LightRedHealth[i],0);
TextDrawBackgroundColor(LightRedHealth[i],0x000000ff);
TextDrawFont(LightRedHealth[i],3);
TextDrawLetterSize(LightRedHealth[i],1.000000,0.199999);
TextDrawColor(LightRedHealth[i],0xffffffff);
TextDrawSetOutline(LightRedHealth[i],1);
TextDrawSetProportional(LightRedHealth[i],1);
TextDrawSetShadow(LightRedHealth[i],1);
TextDrawShowForPlayer(i, LightRedHealth[i]);
LightRedHealthCreated[i] = true;
if(CarHealth < 250)
{
if(ExclamationShown[i] == true)
{
TextDrawHideForPlayer(i, Text:Exclamation);
ExclamationShown[i] = false;
}
else
{
TextDrawShowForPlayer(i, Text:Exclamation);
ExclamationShown[i] = true;
}
}
else if(CarHealth > 250)
{
if(ExclamationShown[i] == true)
{
TextDrawHideForPlayer(i, Text:Exclamation);
ExclamationShown[i] = false;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(LightYellowSpeedCreated[i] == true)
{
TextDrawDestroy(LightYellowSpeed[i]);
}
LightYellowSpeed[i] = TextDrawCreate(537.000000,404.000000,"_");
TextDrawUseBox(LightYellowSpeed[i],1);
TextDrawBoxColor(LightYellowSpeed[i],0xffff0066);
if(Distance >= 75)
{
TextDrawTextSize(LightYellowSpeed[i],589.000000,0.000000);
}
else
{
TextDrawTextSize(LightYellowSpeed[i], floatadd(533.0, floatdiv(Distance, 1.33928571428)),0.000000);
}
TextDrawAlignment(LightYellowSpeed[i],0);
TextDrawBackgroundColor(LightYellowSpeed[i],0x000000ff);
TextDrawFont(LightYellowSpeed[i],3);
TextDrawLetterSize(LightYellowSpeed[i],1.000000,1.200000);
TextDrawColor(LightYellowSpeed[i],0xffffffff);
TextDrawSetOutline(LightYellowSpeed[i],1);
TextDrawSetProportional(LightYellowSpeed[i],1);
TextDrawSetShadow(LightYellowSpeed[i],1);
TextDrawShowForPlayer(i, LightYellowSpeed[i]);
LightYellowSpeedCreated[i] = true;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
OldX[i] = X; OldY[i] = Y; OldZ[i] = Z;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
else
{
if(TextDrawsShown[i] == true)
{
TextDrawHideForPlayer(i, Text:Black0);
TextDrawHideForPlayer(i, Text:White1);
TextDrawHideForPlayer(i, Text:White2);
TextDrawHideForPlayer(i, Text:BlackHealth);
TextDrawHideForPlayer(i, Text:DarkRedHealth);
TextDrawHideForPlayer(i, Text:BlackSpeed);
TextDrawHideForPlayer(i, Text:DarkYellowSpeed);
TextDrawHideForPlayer(i, Text:Marker);
TextDrawHideForPlayer(i, Text:Exclamation);
TextDrawsShown[i] = false;
}
TextDrawHideForPlayer(i, Text:VHS[i]);
TextDrawHideForPlayer(i, Text:LightRedHealth[i]);
TextDrawHideForPlayer(i, Text:LightYellowSpeed[i]);
}
}
}
}
if you still don't understand, post ur gamemode
Re: How to add this FS to GM? -
Dragony92 - 11.04.2011
I havent ongamemodeexit...
I have OnPlayerDisconnect, is that same?
Re: How to add this FS to GM? -
tanush - 12.04.2011
* tanush facepalm, onplayerdisconnect is when player leaves the server and ongamemodeexit is when you close ur server...so put it on ongamemodeexit
Re: How to add this FS to GM? -
Dragony92 - 12.04.2011
But i dont have ongamemodeexit in my gamemode (Raven), can you tell me how to create it?
Re: How to add this FS to GM? -
AsSassINz - 12.04.2011
GameModeExitFunc
Re: How to add this FS to GM? -
Dragony92 - 12.04.2011
I solved the problem, thanks...
~lock topic~
Re: How to add this FS to GM? -
NotoriousMOB - 12.04.2011
Maybe you should just use it as a FS?
what happends when you use it as a Filterscript ?