Wysłany: 2013-07-23, 19:12
siudo97
Wiek: 29 Na forum: 4704 dni Posty: 42
Nick w MP: Siudo
Piwa : 67
Witam, mam problemossss
A wi?c, gdy jestem na serwerze licznik mi dzia?a w 100% ale gdy wejdzie gracz m?j licznik ginie i on go dostaje nwm co jest prosze oto kod ))
Kod: new Text3D:Licznik[MAX_PLAYERS][MAX_VEHICLES];
new VehicleName[212][] = {
{"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"},{"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"},{"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"},{"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"},{"Duneride"},{"Sweeper"},
{"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
{"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
{"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
{"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
{"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
{"Utility Trailer"}
};
public OnPlayerUpdate(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Float:vh;
new car = GetPlayerVehicleID(playerid);
new h, string[256];
GetVehicleHealth(car, vh);
h = floatround(vh) / 10;
new Float:speed = GetPlayerSpeed(playerid);
new ss = floatround(speed);
format(string, sizeof(string), ""white"*** Licznik ***\n"yellow"Nazwa*: "green"%s\n"yellow"Pr?dko??*: "green"%i "yellow"km/h*\n?ycie*: %s%i\n"white"::::::::::::::::::", VehicleName[GetVehicleModel(GetPlayerVehicleID(playerid)) - 400], ss, DamageColor(h), h);
Update3DTextLabelText(Licznik[playerid][car], COLOR_YELLOW , string);
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_ONFOOT)
{
Delete3DTextLabel(Licznik[playerid][GetPlayerVehicleID(playerid)]);
}
if(newstate == PLAYER_STATE_DRIVER)
{
Delete3DTextLabel(Licznik[playerid][GetPlayerVehicleID(playerid)]);
Licznik[playerid][GetPlayerVehicleID(playerid)] = Create3DTextLabel(""red"?adowanie...", -1, 0.0, 0.0, 0.0, 50.0, 0, 0);
Attach3DTextLabelToVehicle(Licznik[playerid][GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), 0.0, 0.0, 0.0);
}
return 1;
}
stock Float:GetPlayerSpeed(playerid, bool:az = true)
{
new Float:SpeedX, Float:SpeedY, Float:SpeedZ;
new Float:prd;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), SpeedX, SpeedY, SpeedZ);
else GetPlayerVelocity(playerid, SpeedX, SpeedY, SpeedZ);
if(az) prd = floatsqroot(floatadd(floatpower(SpeedX, 2.0), floatadd(floatpower(SpeedY, 2.0), floatpower(SpeedZ, 2.0))));
else prd = floatsqroot(floatadd(floatpower(SpeedX, 2.0), floatpower(SpeedY, 2.0)));
prd = floatround(prd * 100 * 1.61);
return prd;
}
stock DamageColor(Float: h) {
new str[64];
if (h <= 30)
format(str, sizeof(str), ""red"");
else if (h < 60)
format(str, sizeof(str), ""orange"");
else
format(str, sizeof(str), ""green"");
return str;
}
Wysłany: 2013-07-23, 21:49
Kurio
Wiek: 35 Na forum: 5511 dni Posty: 122
Piwa : 17
Bardziej poka? OnPlayerConnect i OnPlayerDisconnect - bo s?dz? ?e tu jest problem, i pewnie usuwasz czy zerujesz komu? licznik za pomoc? p?tli, czego robi? nie powiniene?. albo co? innego dziwnego si? dzieje.
Bo z powy?szego nic niepokoj?cego nie widz?, ale za to z "objaw?w" kt?re napisa?e? ju? tak
Wysłany: 2013-07-24, 14:39
siudo97
Wiek: 29 Na forum: 4704 dni Posty: 42
Nick w MP: Siudo
Piwa : 67
Jak ci pokaza? wi?cej jak to jest ca?o?? ?
Podpis
Klepnij mnie
Wysłany: 2013-07-24, 14:58
Kurio
Wiek: 35 Na forum: 5511 dni Posty: 122
Piwa : 17
Pokaza? - OnPlayerConnect i OnPlayerDisconnect. nie wklei?e? tego wy?ej.
Ewentualnie jest mo?liwo?? ?e masz problem z mieszaniem si? indeks?w tablic.
Czemu licznik robisz w 3Dtexcie a nie jako textdraw?
Wysłany: 2013-07-24, 15:44
siudo97
Wiek: 29 Na forum: 4704 dni Posty: 42
Nick w MP: Siudo
Piwa : 67
To jest ca?y skrypt masz a dlaczego w 3Dtexcie to jest licznik w aucie nie na ekranie tam gdzie tylko w aucie
Kod: #include a_samp.inc
#define white "{FFFFFF}"
#define yellow "{FAF623}"
#define orange "{F2C80C}"
#define red "{FF002B}"
#define green "{3DE3B1}"
#define COLOR_YELLOW 0xFFFF00FF
new Float:Przebieg[MAX_VEHICLES];
public OnGameModeInit();
{
SetTimer("odprzebiegu", 3000, true);
new Text3D:Licznik[MAX_PLAYERS][MAX_VEHICLES];
new VehicleName[212][] = {
{"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"},{"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"},{"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"},{"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"},{"Duneride"},{"Sweeper"},
{"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
{"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
{"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
{"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
{"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
{"Utility Trailer"}
};
public OnPlayerUpdate(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Float:vh;
new car = GetPlayerVehicleID(playerid);
new h, string[256];
GetVehicleHealth(car, vh);
h = floatround(vh) / 10;
new Float:speed = GetPlayerSpeed(playerid);
new ss = floatround(speed);
format(string, sizeof(string), ""white"*** Licznik ***\n"yellow"Nazwa*: "green"%s\n"yellow"Pr?dko??*: "green"%i "yellow"km/h*\n?ycie*: %s%i\n"white"Przebieg:", VehicleName[GetVehicleModel(GetPlayerVehicleID(playerid)) - 400], ss,Przebieg[vid], DamageColor(h), h);
Update3DTextLabelText(Licznik[playerid][car], COLOR_YELLOW , string);
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_ONFOOT)
{
Delete3DTextLabel(Licznik[playerid][GetPlayerVehicleID(playerid)]);
}
if(newstate == PLAYER_STATE_DRIVER)
{
Delete3DTextLabel(Licznik[playerid][GetPlayerVehicleID(playerid)]);
Licznik[playerid][GetPlayerVehicleID(playerid)] = Create3DTextLabel(""red"?adowanie...", -1, 0.0, 0.0, 0.0, 50.0, 0, 0);
Attach3DTextLabelToVehicle(Licznik[playerid][GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), 0.0, 0.0, 0.0);
}
return 1;
}
stock Float:GetPlayerSpeed(playerid, bool:az = true)
{
new Float:SpeedX, Float:SpeedY, Float:SpeedZ;
new Float:prd;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), SpeedX, SpeedY, SpeedZ);
else GetPlayerVelocity(playerid, SpeedX, SpeedY, SpeedZ);
if(az) prd = floatsqroot(floatadd(floatpower(SpeedX, 2.0), floatadd(floatpower(SpeedY, 2.0), floatpower(SpeedZ, 2.0))));
else prd = floatsqroot(floatadd(floatpower(SpeedX, 2.0), floatpower(SpeedY, 2.0)));
prd = floatround(prd * 100 * 1.61);
return prd;
}
stock DamageColor(Float: h) {
new str[64];
if (h <= 30)
format(str, sizeof(str), ""red"");
else if (h < 60)
format(str, sizeof(str), ""orange"");
else
format(str, sizeof(str), ""green"");
return str;
}
new VID;
forward odprzebiegu();
public odprzebiegu(){
for(new i=0;i<MAX_PLAYERS;i++){
new vehid = GetPlayerVehicleID(i);
Przebieg[vehid]+=0.1;
}
}
}
return 1;
}
Wi?cej ani mnie kodu niema...
Podpis
Klepnij mnie
Wysłany: 2013-07-24, 15:56
Kurio
Wiek: 35 Na forum: 5511 dni Posty: 122
Piwa : 17
Yyyy... ale przecie? mo?esz wy?wietla? pr?dko?? pojazdu dla gracza na ekranie oO nie rozumiem Cie.
Poza tym to jest tw?j GameMode czy skrypt?
bo nie rozumiem czemu u?ywasz:
Kod:
Wysłany: 2013-07-24, 18:03
siudo97
Wiek: 29 Na forum: 4704 dni Posty: 42
Nick w MP: Siudo
Piwa : 67
To jest skrypt ile razy mam ci pisa?...
Podpis
Klepnij mnie
Wysłany: 2013-07-24, 18:39
Kurio
Wiek: 35 Na forum: 5511 dni Posty: 122
Piwa : 17
To w takim razie czemu u?ywasz public OnGameModeInit(); w skrypcie.
we? pomy?l troch? ch?opie zanim zaczniesz si? irytowa? na kogo?.
Wysłany: 2013-07-24, 19:04
siudo97
Wiek: 29 Na forum: 4704 dni Posty: 42
Nick w MP: Siudo
Piwa : 67
Nie chcesz to nie pomagaj na si?e mia?e? pom?c rozwi?za? problem a nie sie czepia? o OnGameModeInit();
Podpis
Klepnij mnie
Wysłany: 2013-07-24, 20:39
Kurio
Wiek: 35 Na forum: 5511 dni Posty: 122
Piwa : 17
We? si? opanuj cz?owieku, chamstwem nic nie za?atwisz, a dodatkowo nikt Ci nie pomo?e.
Szukam problemu, aby go naprawi? - bo sam nie potrafisz, a i czepiasz si? wszystkiego co ci kto? powie, aby ci pom?c.
Tak poza tym, to czepiam si? o OnGameModeInit(); bo nie wiem kto cie nauczy? u?ywa? tego w skrypcie, ale ty b??du nie widzisz i nie chcesz da? sobie pom?c, wolisz kogo? zjecha?. W takim razie nie pozostaje mi nic innego jak pozostawi? cie z twoim problem i niewychowaniem.
Powodzenia.
Wysłany: 2013-07-25, 11:05
siudo97
Wiek: 29 Na forum: 4704 dni Posty: 42
Nick w MP: Siudo
Piwa : 67
Kurio , Dobrz bez ?aski sam sobie zrobi?em juz bo na twoj? pomoc to jeszcze 100 zbednych post?w b?de czeka?
Podpis
Klepnij mnie
Wysłany: 2013-07-25, 11:54
Kurio
Wiek: 35 Na forum: 5511 dni Posty: 122
Piwa : 17
Twoje chamstwo osi?gn??o chyba szczytu.
Ciesz? si? ?e sobie poradzi?e? i nie da?e? sobie pom?c. je?eli o co? pytam, to nie dlatego ?e mi si? tak podoba, tylko chc? rozwi?za? problem, a ty niestety nie dajesz sobie pom?c.
Wysłany: 2013-07-25, 12:32
siudo97
Wiek: 29 Na forum: 4704 dni Posty: 42
Nick w MP: Siudo
Piwa : 67
Dobra dzi?ki za starania masz respa i piwo.
Podpis
Klepnij mnie
Wysłany: 2013-07-25, 12:35
Kurio
Wiek: 35 Na forum: 5511 dni Posty: 122
Piwa : 17
Nie chodzi mi o respa i piwo, tylko o to, ?e jak si? o co? pytam to nie po to aby by? ci uci??liwym, tylko szukam problemu, ?eby rozwi?za? problem. wi?c nast?pnym razem nie marnuj mojego i swojego czasu, odpisuj?c na ka?dy m?j post "po co ci to, wszystko ci da?em, nie umiesz mi pom?c" tylko po prostu to zr?b.
nie mam twojego gamemodu na komputerze, nie moge go dowolnie przegl?da?, wi?c prosz? aby? co? wys?a?, a nie ?eby? pisa? g?upie komentarze w moj? stron?, jakbym by? jakim? idiot? mam nadzieje, ?e mnie rozumiesz.
Tagi: licznik :: się :: popsuł
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: