Wysłany: 2017-07-27, 13:20
BureWure
Wiek: 29 Na forum: 3547 dni Posty: 29
Piwa : 30
Mam problem z streamerem, zawsze wykonuje sie ten sam checkpoint pomocy!
Pawn
public OnPlayerEnterDynamicCP ( playerid , checkpointid )
{
if( checkpointid == PracaSklep0 [ playerid ])
{
DestroyDynamicCP ( PracaSklep0 [ playerid ]);
new box = random ( 3 );
if( box == 0 )
{
SetPlayerAttachedObject ( playerid , 5 , 19638 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
if( box == 1 )
{
SetPlayerAttachedObject ( playerid , 5 , 19636 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
if( box == 2 )
{
SetPlayerAttachedObject ( playerid , 5 , 2969 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
print( "Dano cp" );
PracaSklep1 [ playerid ] = CreateDynamicCP ( 243.7237 ,- 45.6671 , 1.5853 , 1 , - 1 , 0 , playerid , 50 );
return 1 ;
}
if( checkpointid == PracaSklep1 [ playerid ])
{
DestroyDynamicCP ( PracaSklep1 [ playerid ]);
GivePlayerMoney ( playerid , 3 );
RemovePlayerAttachedObject ( playerid , 5 );
PracaSklep2 [ playerid ] = CreateDynamicCP ( 255.8060 ,- 54.3830 , 1.5703 , 1 , - 1 , 0 , playerid , 50 );
return 1 ;
}
if( checkpointid == PracaSklep2 [ playerid ])
{
DestroyDynamicCP ( PracaSklep2 [ playerid ]);
new box = random ( 3 );
if( box == 0 )
{
SetPlayerAttachedObject ( playerid , 5 , 19638 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
if( box == 1 )
{
SetPlayerAttachedObject ( playerid , 5 , 19636 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
if( box == 2 )
{
SetPlayerAttachedObject ( playerid , 5 , 2969 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
PracaSklep3 [ playerid ] = CreateDynamicCP ( 245.6620 ,- 43.4706 , 1.5853 , 1 , - 1 , 0 , playerid , 50 );
return 1 ;
}
if( checkpointid == PracaSklep3 [ playerid ])
{
DestroyDynamicCP ( PracaSklep3 [ playerid ]);
GivePlayerMoney ( playerid , 3 );
RemovePlayerAttachedObject ( playerid , 5 );
PracaSklep4 [ playerid ] = CreateDynamicCP ( 255.7639 ,- 59.7145 , 1.5703 , 1 , - 1 , 0 , playerid , 50 );
return 1 ;
}
if( checkpointid == PracaSklep4 [ playerid ])
{
DestroyDynamicCP ( PracaSklep4 [ playerid ]);
new box = random ( 3 );
if( box == 0 )
{
SetPlayerAttachedObject ( playerid , 5 , 19638 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
if( box == 1 )
{
SetPlayerAttachedObject ( playerid , 5 , 19636 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
if( box == 2 )
{
SetPlayerAttachedObject ( playerid , 5 , 2969 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
PracaSklep5 [ playerid ] = CreateDynamicCP ( 244.7875 ,- 44.2390 , 1.5853 , 1 , - 1 , 0 , playerid , 50 );
return 1 ;
}
if( checkpointid == PracaSklep5 [ playerid ])
{
DestroyDynamicCP ( PracaSklep5 [ playerid ]);
GivePlayerMoney ( playerid , 3 );
RemovePlayerAttachedObject ( playerid , 5 );
PracaSklep6 [ playerid ] = CreateDynamicCP ( 244.3752 ,- 59.3114 , 1.5776 , 1 , - 1 , 0 , playerid , 50 );
return 1 ;
}
if( checkpointid == PracaSklep6 [ playerid ])
{
DestroyDynamicCP ( PracaSklep6 [ playerid ]);
new box = random ( 3 );
if( box == 0 )
{
SetPlayerAttachedObject ( playerid , 5 , 19638 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
if( box == 1 )
{
SetPlayerAttachedObject ( playerid , 5 , 19636 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
if( box == 2 )
{
SetPlayerAttachedObject ( playerid , 5 , 2969 , 5 , 0.1 , 0 , 0.2 , - 90 , 0 , 0 );
}
PracaSklep7 [ playerid ] = CreateDynamicCP ( 244.8187 ,- 45.2606 , 1.5853 , 1 , - 1 , 0 , playerid , 50 );
return 1 ;
}
if( checkpointid == PracaSklep7 [ playerid ])
{
DestroyDynamicCP ( PracaSklep7 [ playerid ]);
RemovePlayerAttachedObject ( playerid , 5 );
GivePlayerMoney ( playerid , 3 );
PracaSklep8 [ playerid ] = CreateDynamicCP ( 244.5232 ,- 54.5706 , 1.5776 , 1 , - 1 , 0 , playerid , 50 );
return 1 ;
}
if( checkpointid == PracaSklep8 [ playerid ])
{
DestroyDynamicCP ( PracaSklep8 [ playerid ]);
GivePlayerMoney ( playerid , 1 );
return 1 ;
}
return 1 ;
}
Zawsze wykonuje sie 1 i w konsoli pisze "Dano cp" ? Daje piwka i respekt
Podpis
Podpis NIE został zablokowany przez Administrację
Wysłany: 2017-07-27, 23:18
Pr0f3ssi0n4LisT
Wiek: 25 Na forum: 6845 dni Posty: 120
Piwa : 3653
Logiczne myslenie sie klania
Tworzysz gdzies czekpoint
Pawn PracaSklep0 [ playerid ] = CreateDynamicCP (...);
i ma np ID 1
pozniej wchodzisz w niego
Pawn if( checkpointid == PracaSklep0 [ playerid ])
nastepnie go usuwasz
Pawn DestroyDynamicCP ( PracaSklep0 [ playerid ]);
co zwalnia w streamerze zajete ID 1 ale tablica PracaSklep0[playerid] nadal przechowuje ID 1 czekpointu
po czym tworzysz 'nowy' czekpoint ktory znowu ma ID 1 bo tak dziala streamer ze szuka pierwsze wolne ID
Pawn PracaSklep1 [ playerid ] = CreateDynamicCP ( 243.7237 ,- 45.6671 , 1.5853 , 1 , - 1 , 0 , playerid , 50 );
i koniec koncow wchodzisz w czekpoint PracaSklep1[playerid] ktory jest jako ID 1 ale zawsze wykona sie ten pierwszy if ( if(checkpointid == PracaSklep0[playerid]) )
bo checkpointid ma ID 1 i Twoja tablica PracaSklep0[playerid] ma nadal ID 1 z poprzedniego czekpointa bo jej nie zresetowales/ustawiles innej wartosci niz 1
i teraz dodaj 2 + 2 i wykombinuj jak to naprawic
Wysłany: 2017-07-28, 11:32
BureWure
Wiek: 29 Na forum: 3547 dni Posty: 29
Piwa : 30
Hah, gdybys umial czytac to bys zauwazyl ze tak jest... boze debilizm sie rozprzestrzenia...
Podpis
Podpis NIE został zablokowany przez Administrację
Wysłany: 2017-07-28, 14:06
Combacior
Wiek: 29 Na forum: 5796 dni Posty: 1516
Piwa : 2161
Debilizm w czyim wykonaniu? Kto? stara si? pom?c i oczywi?cie ?le, bo nie poda? gotowego kodu. My?l troch?, jak niszczysz checkpoint, to mo?e wyzerujesz te? tablic??
Pawn public OnPlayerEnterDynamicCP ( playerid , checkpointid )
{
if( checkpointid == 1 )
{
DestroyDynamicCP ( 1 );
print( "Dano cp" );
PracaSklep1 [ playerid ] = CreateDynamicCP ( 243.7237 ,- 45.6671 , 1.5853 , 1 , - 1 , 0 , playerid , 50 ); //PracaSklep1[playerid] = 1, PracaSklep0[playerid] = 1 - ???
return 1 ;
}
}
Kombinuj o co chodzi, bo takowy problem wyst?puje w uj cz?sto i jeszcze troch?. Ile razy kto? mia? problem z prywatnymi pojazdami, tekstami 3D, bo nie wyzerowa? tablicy.
Tagi: zle :: sie :: wykonuje
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: