Wysłany: 2013-07-23, 16:08
Glut
Wiek: 31 Na forum: 4865 dni Posty: 46
Piwa : 5
I ju? mam problem... Mam komend? /pojazd zaparkuj, w kt?rej zamiast vUID jest Car[playerid][UID]: Pawn else if( strfind ( params , "zaparkuj" , true ) == 0 )
{
if( sscanf ( params , "s" , params )) return SendClientMessage ( playerid , COLOR_ORANGE , "U?»YJ: /pojazd zaparkuj" );
new CarFile [ 30 ];
format ( CarFile , sizeof ( CarFile ), "%d.ini" , Car [ playerid ][ UID ]);
if( IsPlayerInAnyVehicle ( playerid ) == 1 )
{
if( IsPlayerInVehicle ( playerid , Car [ playerid ][ VehicleGameID ]) == 1 )
{
new Float : vInfo [ 5 ];
new Damage [ 4 ];
GetVehiclePos ( Car [ playerid ][ VehicleGameID ], vInfo [ 0 ], vInfo [ 1 ], vInfo [ 2 ]);
GetVehicleZAngle ( Car [ playerid ][ VehicleGameID ], vInfo [ 3 ]);
GetVehicleHealth ( Car [ playerid ][ VehicleGameID ], vInfo [ 4 ]);
GetVehicleDamageStatus ( Car [ playerid ][ VehicleGameID ], Damage [ 0 ], Damage [ 1 ], Damage [ 2 ], Damage [ 3 ]);
dini_FloatSet ( CarFile , "X" , vInfo [ 0 ]);
dini_FloatSet ( CarFile , "Y" , vInfo [ 1 ]);
dini_FloatSet ( CarFile , "Z" , vInfo [ 2 ]);
dini_FloatSet ( CarFile , "A" , vInfo [ 3 ]);
dini_FloatSet ( CarFile , "Health" , vInfo [ 4 ]);
dini_IntSet ( CarFile , "Panels" , Damage [ 0 ]);
dini_IntSet ( CarFile , "Doors" , Damage [ 1 ]);
dini_IntSet ( CarFile , "Lights" , Damage [ 2 ]);
dini_IntSet ( CarFile , "Tires" , Damage [ 3 ]);
DestroyVehicle ( Car [ playerid ][ VehicleGameID ]);
Car [ playerid ][ VehicleGameID ] = CreateVehicle ( dini_Int ( CarFile , "ModelID" ), dini_Float ( CarFile , "X" ), dini_Float ( CarFile , "Y" ), dini_Float ( CarFile , "Z" ), dini_Float ( CarFile , "A" ), dini_Int ( CarFile , "Color1" ), dini_Int ( CarFile , "Color2" ),- 1 );
SetVehicleNumberPlate ( Car [ playerid ][ VehicleGameID ], dini_Get ( CarFile , "Plate" ));
ChangeVehiclePaintjob ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "Paintjob" ));
SetVehicleHealth ( Car [ playerid ][ VehicleGameID ], dini_Float ( CarFile , "Health" ));
UpdateVehicleDamageStatus ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "Panels" ), dini_Int ( CarFile , "Doors" ), dini_Int ( CarFile , "Lights" ), dini_Int ( CarFile , "Tires" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "SPOILER" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "HOOD" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "ROOF" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "SIDESKIRT" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "LAMPS" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "NITRO" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "EXHAUST" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "WHEELS" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "STEREO" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "HYDRAULICS" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "FRONT_BUMPER" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "REAR_BUMPER" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "VENT_RIGHT" ));
AddVehicleComponent ( Car [ playerid ][ VehicleGameID ], dini_Int ( CarFile , "VENT_LEFT" ));
PutPlayerInVehicle ( playerid , Car [ playerid ][ VehicleGameID ], 0 );
new str [ 70 ];
new model = GetVehicleModel ( Car [ playerid ][ VehicleGameID ]);
format ( str , sizeof ( str ), "* Zaparkowa?e? pojazd '%s' (UID: %d)" , VehicleName [ model - MODEL_VEHICLE ], Car [ playerid ][ UID ]);
ChatClear ( playerid );
SendClientMessage ( playerid , COLOR_ORANGE , "* (INFO) Pojazd:" );
SendClientMessage ( playerid , COLOR_WHITE , str );
}
else
{
SendClientMessage ( playerid , COLOR_GREY , " Nie jeste? w swoim poje??dzie!" );
}
}
else
{
SendClientMessage ( playerid , COLOR_GREY , " Musisz by? w poje?dzie!" );
}
}
To samo z komend? otw?rz i zamknij: Pawn CMD : otworz ( playerid , params [])
{
#pragma unused params
if( IsPlayerInVehicle ( playerid , Car [ playerid ][ VehicleGameID ]) == 1 )
{
new CarFile [ 30 ];
new doors [ 16 ];
new privstring [ 128 ];
format ( CarFile , sizeof ( CarFile ), "%d.ini" , Car [ playerid ][ UID ]);
printf ( "UID: %d" , Car [ playerid ][ UID ]);
if( dini_Int ( CarFile , "Locked" ) == 0 )
{
dini_IntSet ( CarFile , "Locked" , 1 );
GameTextForPlayer ( playerid , "~r~ZAMKNIETY!" , 3000 , 4 );
PlayerPlaySound ( playerid , 6400 , 0.0 , 0.0 , 0.0 );
format ( doors , 16 , "Zamkni?te" );
format ( privstring , 128 , "UID:%d\nW?a?ciciel:%s\nDrzwi:%s" , Car [ playerid ][ UID ], dini_Get ( CarFile , "Owner" ), doors );
Update3DTextLabelText ( privlabel [ Car [ playerid ][ VehicleGameID ]], ORANGE , privstring );
}
else
{
dini_IntSet ( CarFile , "Locked" , 0 );
GameTextForPlayer ( playerid , "~g~OTWARTY!" , 3000 , 4 );
PlayerPlaySound ( playerid , 6400 , 0.0 , 0.0 , 0.0 );
format ( doors , 16 , "Otwarte" );
format ( privstring , 128 , "UID:%d\nW?a?ciciel:%s\nDrzwi:%s" , Car [ playerid ][ UID ], dini_Get ( CarFile , "Owner" ), doors );
Update3DTextLabelText ( privlabel [ Car [ playerid ][ VehicleGameID ]], ORANGE , privstring );
}
}
else
{
new CarFile [ 30 ];
new doors [ 16 ];
new privstring [ 128 ];
new Float : vPos [ 3 ];
format ( CarFile , sizeof ( CarFile ), "%d.ini" , Car [ playerid ][ UID ]);
GetVehiclePos ( Car [ playerid ][ VehicleGameID ], vPos [ 0 ], vPos [ 1 ], vPos [ 2 ]);
if( IsPlayerInRangeOfPoint ( playerid , 7 , vPos [ 0 ], vPos [ 1 ], vPos [ 2 ]) == 1 )
{
if( dini_Int ( CarFile , "Locked" ) == 0 )
{
dini_IntSet ( CarFile , "Locked" , 1 );
GameTextForPlayer ( playerid , "~r~ZAMKNIETY!" , 3000 , 4 );
PlayerPlaySound ( playerid , 6400 , 0.0 , 0.0 , 0.0 );
format ( doors , 16 , "Zamkni?te" );
format ( privstring , 128 , "UID:%d\nW?a?ciciel:%s\nDrzwi:%s" , Car [ playerid ][ UID ], dini_Get ( CarFile , "Owner" ), doors );
Update3DTextLabelText ( privlabel [ Car [ playerid ][ VehicleGameID ]], ORANGE , privstring );
ApplyAnimation ( playerid , "HEIST9" , "Use_SwipeCard" , 4.1 , 0 , 0 , 0 , 0 , 0 );
}
else
{
dini_IntSet ( CarFile , "Locked" , 0 );
GameTextForPlayer ( playerid , "~g~OTWARTY!" , 3000 , 4 );
PlayerPlaySound ( playerid , 6400 , 0.0 , 0.0 , 0.0 );
format ( doors , 16 , "Otwarte" );
format ( privstring , 128 , "UID:%d\nW?a?ciciel:%s\nDrzwi:%s" , Car [ playerid ][ UID ], dini_Get ( CarFile , "Owner" ), doors );
Update3DTextLabelText ( privlabel [ Car [ playerid ][ VehicleGameID ]], ORANGE , privstring );
ApplyAnimation ( playerid , "HEIST9" , "Use_SwipeCard" , 4.1 , 0 , 0 , 0 , 0 , 0 );
}
}
}
return 1 ;
}
Podpis
NA PRZYSZŁOŚĆ KRZYCZ GŁOŚNIEJ BO MAM APARAT SŁUCHOWY I NIE SŁYSZĘ LITER!
Wysłany: 2013-07-23, 18:58
adamoloxD
PaFFner
Wiek: 32 Na forum: 5928 dni Posty: 64
Piwa : 523
Ale co si? dzieje?
Podpis
Kod:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return DestroyVehicle(vehicleid);
}
Wysłany: 2013-07-23, 20:59
Glut
Wiek: 31 Na forum: 4865 dni Posty: 46
Piwa : 5
Tam jest Car[playerid][UID], a ja chc? mie? wszystko na Car[vUID][Druga zmienna], bo te funkcje nie b?d? dzia?a? na pojazdy, kt?re wcze?niej zrespili?my.
Podpis
NA PRZYSZŁOŚĆ KRZYCZ GŁOŚNIEJ BO MAM APARAT SŁUCHOWY I NIE SŁYSZĘ LITER!
Wysłany: 2013-07-23, 21:03
adamoloxD
PaFFner
Wiek: 32 Na forum: 5928 dni Posty: 64
Piwa : 523
Spr?buj pozamienia? playerid => vUID, je?li dalej nie to spr?buj? to u siebie wykmini?.
Podpis
Kod:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return DestroyVehicle(vehicleid);
}
Wysłany: 2013-07-23, 21:46
Kurio
Wiek: 35 Na forum: 5511 dni Posty: 122
Piwa : 17
Hm, serio nie lepiej zrobi? spawn tylko 1 auta? troch? tak bez sensu ?eby kto? spawnowa? 10 aut, gdy tylko jednym mo?e je?dzi? ;d kilka problem?w od razu by si? samo rozwi?za?o, bo tak ten skrypt jest zrobiony, ?eby dzia?a? na 1 auto.
Wysłany: 2013-07-23, 21:49
adamoloxD
PaFFner
Wiek: 32 Na forum: 5928 dni Posty: 64
Piwa : 523
Wysłany: 2013-07-23, 23:42
Kurio
Wiek: 35 Na forum: 5511 dni Posty: 122
Piwa : 17
Hm, ale wiesz ;d lepsza jest nauka jak co? piszesz sam, i wiesz co spieprzy?e?
ni? poprawia? co? po kim?, kto zrobi? to do konkretnego celu a nie do innego.
Wi?c szybciej by ju? to sam zrobi? ni? to poprawia?.
Ale jak chce to niech robi mo?e te? pomo?e przy tym innym osobom, kt?re maj? z tym problem, a same nie potrafi? zrobi?, kompletnie nic.
Wysłany: 2013-07-24, 18:47
Glut
Wiek: 31 Na forum: 4865 dni Posty: 46
Piwa : 5
Wiecie co? Zostawi? ten spawn w spokoju i zrobi? ten spawn inaczej, ni? my?la?em, ale lepiej. Dzi?ki Wam wszystkim za fatyg? (wreszcie b?d? wiedzia? jak p??niej zmieni? ten spawn). Oboje dostajecie +10 Reputacji. Temat Zamykam.
Podpis
NA PRZYSZŁOŚĆ KRZYCZ GŁOŚNIEJ BO MAM APARAT SŁUCHOWY I NIE SŁYSZĘ LITER!
Tagi: [rozwiązany] :: komenda :: działająca :: raz.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: