Jump to content

Question

Posted

Salutare ! Am ceva probleme cu masinile factiunilor. Deci, scriptul e cam asa:

Mai intai, global array pt masinile de politie:

[pawn]

new LSPDCar[ 12 ];

[/pawn]

Pe urma, am creat masinile:

[pawn]

public OnGameModeInit()

{

LSPDCar[ 0 ] = AddStaticVehicle( 596, 1570.4307, -1710.5015, 5.6118, 359.0704, 0, 1 ); // LSPDCruiser1

LSPDCar[ 1 ] = AddStaticVehicle( 596, 1574.4824, -1710.7050, 5.6126, 359.5297, 0, 1 ); // LSPDCruiser2

LSPDCar[ 2 ] = AddStaticVehicle( 596, 1578.6796, -1710.6199, 5.6113, 358.9721, 0, 1 ); // LSPDCruiser3

LSPDCar[ 3 ] = AddStaticVehicle( 596, 1583.5558, -1710.6246, 5.6117, 358.6743, 0, 1 ); // LSPDCruiser4

LSPDCar[ 4 ] = AddStaticVehicle( 596, 1587.4552, -1710.6227, 5.6123, 359.9478, 0, 1 ); // LSPDCruiser5

LSPDCar[ 5 ] = AddStaticVehicle( 596, 1591.5229, -1710.7249, 5.6120, 0.7387, 0, 1 ); // LSPDCruiser6

LSPDCar[ 6 ] = AddStaticVehicle( 596, 1602.0529, -1683.9634, 5.6110, 90.7847, 0, 1 ); // PDCruiser7

LSPDCar[ 7 ] = AddStaticVehicle( 596, 1601.9954, -1688.0194, 5.6131, 89.2227, 0, 1 ); // PDCruiser8

LSPDCar[ 8 ] = AddStaticVehicle( 596, 1601.7228, -1692.0026, 5.6109, 88.5967, 0, 1 ); // PDCruiser9

LSPDCar[ 9 ] = AddStaticVehicle( 596, 1601.3859, -1696.0682, 5.6096, 90.4116, 0, 1 ); // PDCruiser10

LSPDCar[ 10 ] = AddStaticVehicle( 596, 1600.9125, -1700.1434, 5.6098, 89.4584, 0, 1 ); // PDCruiser11

LSPDCar[ 11 ] = AddStaticVehicle( 596, 1601.4318, -1704.2673, 5.6122, 90.6356, 0, 1 ); // PDCruiser12

    return 1;

}

[/pawn]

Totul e bine pana aici. Acum urmeaza problema, cand cineva intra in masina de politie si  GetPVarInt( playerid, "Faction" ) nu e 1 , ar trebui sa`l scoata din masina ... dar nu functioneaza.

[pawn]

public OnPlayerStateChange(playerid, newstate, oldstate)

{

new vid = GetPlayerVehicleID( playerid );

if( vid == LSPDCar[ 11 ] )

{

if( newstate == 2 && GetPVarInt( playerid, "Faction" ) != 1 )

{

RemovePlayerFromVehicle( playerid );

SendClientMessage( playerid, -1, "You don`t have the keys for this car." );

}

}

return 1;

}

[/pawn]

Aveti vreo idee de ce nu functioneaza?

9 answers to this question

Recommended Posts

Posted

    if( newstate == 2 && GetPVarInt( playerid, "Faction" ) != 1 )

IN

    if( newstate == 2 && GetPVarInt( playerid, "Faction" ) = 1 )

u78ch.jpg

CHECK MY CHANNEL!

http://www.youtube.com/user/amysoica

Posted

incearca in loc de 1 sa pui 0 :) poate merge

ba esti noob daca era 0 nu era ala lspd :| reciteste tutorialu lui zh3r0

if( newstate == 2 && GetPVarInt( playerid, "Faction" ) != 1 )

daca era 0 nu mai verifica!

si app in loc de != pune =

si va merge 100% si fa pt toate masinile,,,...,,,....,,,,

u78ch.jpg

CHECK MY CHANNEL!

http://www.youtube.com/user/amysoica

Posted

si app in loc de != pune =

==*

keri22 si CookieEatingMonster, nu mai postati in Discutii Scripting decat cand sunteti siguri ca merge.

Topic solved!

Posted

Deci, eu vroiam sa pun cu '!=', adica daca nu e in factiunea respectiva, sa`l scoata din masina.

Problema era ca am pus doar pt o masina, pt LSPDCar[ 11 ] ... si trebuia sa pun la toate pe rand.

Mersi oricum ca ati sarit sa ma ajutati ! Raman dator :>

Posted

poate functia

RemovePlayerFromVehicle(playerid); //functi  scoate playerul din masina adauga-l unde crezi tu ca e bine...descurcate

te ajuta...

si posteaza aici

http://www.sa-mp.ro/forum/index.php/topic,5356.0.html

Dati TP

New GameMode In Development!-Romania Team Gang War-100%!...Datimi doua Motive afrimative de ce sa-l postez si-l postez...

Posted

TheBoss" post="60416" timestamp="1299961600"]

Dati TP

http://www.sa-mp.ro/forum/index.php/topic,2825.msg50147.html#msg50147

UPDATE: Ninja a instalat un Mod pentru site , diferitele topicuri care sunt rezolvate raman de obicei "abandonate" iar altii se trezesc sa raspunda in ele "readucandu-le la viata" xD , pentru asta de acum moderatorii cand vad un topic rezolva pot da pe un buton care indica faptul ca topicul a fost rezolvat iar in stanga acelui topic va aparea aceasta imagine: topicsolved.gif

TheBoss link=topic=10036.msg60416#msg60416 date=1299961600]

si posteaza aici

http://www.sa-mp.ro/forum/index.php/topic,5356.0.html

Se poate la orice GM problema asta.

Posted

TheBoss" post="60416" timestamp="1299961600"]

poate functia

RemovePlayerFromVehicle(playerid); //functi  scoate playerul din masina adauga-l unde crezi tu ca e bine...descurcate

te ajuta...

si posteaza aici

http://www.sa-mp.ro/forum/index.php/topic,5356.0.html

Dati TP

Haha, vad ca sunteti toti de mare ajutor p`aci. No offence dar jumatate va bagati in seama si habar n`aveti despre ce e vorba. Auzi la asta, sa postez la Probleme Godfather. Pai bre', ce te face sa crezi ca lucrez la Gamemode`ul Godfather?

Ai citit macar postul facut de mine? Daca iti casti ochii, ai sa vezi ca am functia RemovePlayerFromVehicle. Eh, exact ce ziceau ceilalt pe .com la sectiunea Romana.

ps: Am rezolvat problema. Mersi oricum

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.