Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-06-30, 11:58


Skippy

Obserwuje!






Wiek: 31
Na forum: 4856 dni
Posty: 36
Nick w MP: _____

Piwa: 1200

Respekt: 90,9

Ostrzeżeń: 100%
Witam, mam problem z licznikiem w 3dtext.

Problem tkwi w tym, ?e licznik si? nie pokazuje jak wsi?d? do pojazdu.

W czym tkwi problem?



KOD SKRYPTU:

http://pastebin.com/6Ma3KTcv

Podpis
Egaming v.0.1 (BETA) - 5 %
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-30, 17:39


kamyczek







Wiek: 28
Na forum: 5619 dni
Posty: 25

Piwa: 8

Respekt: 50

Ostrzeżeń: 100%
Dodaj to:
Kod:


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
LicznikOld();
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-30, 18:03


Skippy

Obserwuje!






Wiek: 31
Na forum: 4856 dni
Posty: 36
Nick w MP: _____

Piwa: 1200

Respekt: 90,9

Ostrzeżeń: 100%
Teraz po dodaniu tego callbacka te? nie dzia?a.

Podpis
Egaming v.0.1 (BETA) - 5 %
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-30, 18:49


kamyczek







Wiek: 28
Na forum: 5619 dni
Posty: 25

Piwa: 8

Respekt: 50

Ostrzeżeń: 100%
Eh... musisz stworzy? 3dtext w OnFilterScriptInit

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-30, 18:50


okoospokoo







Wiek: 29
Na forum: 5089 dni
Posty: 102
Nick w MP: Shake/LeStunters

Piwa: 273

Respekt: 50

Jak ma Ci si? wy?wietla? jak nie stworzy?e? 3Dtextu ? W OnFilterScriptInit stw?rz labela.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-30, 19:00


Skippy

Obserwuje!






Wiek: 31
Na forum: 4856 dni
Posty: 36
Nick w MP: _____

Piwa: 1200

Respekt: 90,9

Ostrzeżeń: 100%
3d text jest stworzony - Co wy nie widzicie?
Ten callback te? nic nie pomo?e co masz tam na g?rze bo jest funkcja co do tego, ?e jak gracz b?dzie w aucie to ma si? wy?wietli?.

Podpis
Egaming v.0.1 (BETA) - 5 %
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-30, 20:38


xqz

otaku desu!






Wiek: 32
Na forum: 6407 dni
Posty: 723
Nick w MP: xqz

Piwa: 5465

Respekt: 418,6
Respekt: 418,6

Im wiecej graczy w pojezdzie tym szybciej osiagniesz limit 3Dtext?w. Wybrales zle rozwiazanie.

Utworz 3Dtexty od razu dla wszystkich graczy w OnGameModeInit (a najlepiej to podczas wejscia do pojazdu) a pozniej tylko aktualizuj go i przyczepiaj do pojazdu.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-30, 23:16


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Kod:

#include <a_samp>

new VehicleNames[][]= {
{"Landstalker"}, {"Bravura"}, {"Buffalo"}, {"Linerunner"}, {"Perrenial"}, {"Sentinel"}, {"Dumper"}, {"Firetruck"}, {"Trashmaster"}, {"Stretch"},
{"Manana"}, {"Infernus"}, {"Voodoo"}, {"Pony"}, {"Mule"}, {"Cheetah"}, {"Ambulance"}, {"Leviathan"}, {"Moonbeam"}, {"Esperanto"}, {"Taxi"},
{"Washington"}, {"Bobcat"}, {"Mr 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"}, {"Sparrow"},
{"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"},
{"Seasparrow"}, {"Patriot"}, {"Quad"}, {"Coastguard"}, {"Dinghy"}, {"Hermes"}, {"Sabre"}, {"Rustler"}, {"ZR-350"}, {"Walton"}, {"Regina"}, {"Comet"},
{"BMX"}, {"Burrito"}, {"Camper"}, {"Marquis"}, {"Baggage"}, {"Dozer"}, {"Maverick"}, {"News Maverick"}, {"Rancher"}, {"FBI Rancher"}, {"Virgo"},
{"Greenwood"}, {"Jetmax"}, {"Hotring"}, {"Sandking"}, {"Blista Compact"}, {"Police Maverick"}, {"Boxville"}, {"Benson"}, {"Mesa"},{"RC Goblin"},
{"Hotring Racer A"}, {"Hotring Racer B"}, {"Bloodring Banger"}, {"Rancher"}, {"Super GT"}, {"Elegant"}, {"Journey"}, {"Bike"}, {"Mountain Bike"},
{"Beagle"}, {"Cropdust"}, {"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"}, {"Brownstreak"}, {"Vortex"},{"Vincent"}, {"Bullet"}, {"Clover"},
{"Sadler"}, {"Ladder Firetruck"}, {"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"}, {"Newsvan"}, {"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. Van"}, {"Alpha"}, {"Phoenix"},
{"Old Glendale"}, {"Old Sadler"}, {"Luggage Trailer A"}, {"Luggage Trailer B"}, {"Stair Trailer"}, {"Boxville"}, {"Farm Plow"}, {"Utility Trailer"}
};

new Text3D:_TxtCounter[MAX_PLAYERS];

stock GetVehSpeed(vehid)
{
new Float:X, Float:Y, Float:Z;
GetVehicleVelocity(vehid, X, Y, Z);
return floatround(floatsqroot(floatpower(X, 2) + floatpower(Y, 2) + floatpower(Z, 2)) * 200);
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
new s[80];
format(s, sizeof(s), "%s\n%d KM/h", VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400], GetVehSpeed(GetPlayerVehicleID(playerid)));
_TxtCounter[playerid] = Create3DTextLabel(s,-1,1.0,1.0,1.0,10.0,-1);
Attach3DTextLabelToVehicle(_TxtCounter[playerid],GetPlayerVehicleID(playerid), 0.0, 0.0, 1.0);
Update3DTextLabelText(_TxtCounter[playerid], -1, s);
}
if(newstate == PLAYER_STATE_ONFOOT || oldstate == PLAYER_STATE_DRIVER) Delete3DTextLabel(_TxtCounter[playerid]);
return 1;
}

forward @counter();
@counter()
{
new s[158];
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInAnyVehicle(i))
{
format(s, sizeof(s), "%s\n%d KM/h", VehicleNames[GetVehicleModel(GetPlayerVehicleID(i))-400], GetVehSpeed(GetPlayerVehicleID(i)));
Update3DTextLabelText(_TxtCounter[i], -1, s);
}
}
return 1;
}


OnPlayerDisconnect:
Kod:

if(_TxtCounter[playerid] != Text3D:INVALID_3DTEXT_ID) Delete3DTextLabel(_TxtCounter[playerid]);


OnGameModeInit:
Kod:

SetTimer("@counter", 500, true);


Nie, nie ma za co.

Postaw piwo autorowi tego posta
 

 
Tagi: licznik :: 3dtext.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku