Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/08/2019 in all areas

  1. Topic inchis, next ai ban.
    2 points
  2. [11:48:07] [debug] Run time error 4: "Array index out of bounds" [11:48:07] [debug] Accessing element at index 65535 past array upper bound 999 Accesezi un array cu un numar prea mare decat cel stabilit.. e cam greu sa-ti dai seama unde-i problema din cauza public-ului atat de mare si incarcat...
    1 point
  3. @DiBlaine poftim. O constanta cu toate locurile vehiculelor. new const MaxVehicleSeats[ 212 ] = { 4, 2, 2, 2, 4, 4, 1, 2, 2, 4, 2, 2, 2, 4, 2, 2, 4, 2, 4, 2, 4, 4, 2, 2, 2, 1, 4, 4, 4, 2, 1, 9, 1, 2, 2, 0, 2, 9, 4, 2, 4, 1, 2, 2, 2, 4, 1, 2, 1, 2, 0, 2, 1, 1, 1, 2, 2, 2, 4, 4, 2, 2, 1, 2, 1, 2, 4, 4, 2, 2, 4, 2, 1, 1, 2, 2, 1, 2, 2, 4, 2, 1, 4, 3, 1, 1, 1, 4, 4, 2, 4, 2, 4, 1, 2, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 1, 1, 2, 1, 1, 2, 2, 4, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 4, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 4, 2, 2, 2, 2, 2, 4, 4, 2, 2, 4, 4, 2, 1, 2, 2, 2, 2, 2, 2, 4, 4, 2, 2, 1, 2, 4, 4, 1, 0, 0, 1, 1, 2, 1, 2, 2, 4, 2, 4, 4, 2, 4, 1, 0, 4, 2, 2, 2, 2, 0, 0, 2, 2, 1, 1, 4, 4, 4, 2, 2, 2, 2, 2, 4, 2, 0, 0, 0, 4, 0, 0 }; O functie care verifica daca masina X are vreun loc liber, daca are, functia va returna locul liber daca nu, va returna -1. GetFreeSeat( vehicleid ) // sa-mp.com { new vehiclemodel = GetVehicleModel(vehicleid); if( vehiclemodel ) { new bool: seattaken[ 10 ], playerseat = -1 ; foreach( new i : Player ) { if( !IsPlayerInVehicle( i, vehicleid ) ) continue; playerseat = GetPlayerVehicleSeat( i ); if( 0 <= playerseat < 128 ) seattaken[ playerseat ] = true; } for( new v = 0; v < MaxVehicleSeats[ vehiclemodel - 400 ]; v++ ) { if( seattaken[ v ] ) continue; return v; } } return -1; } Un exemplu de comanda: CMD:goto( playerid, params[], help ) { // verificari, etc. new Float: posX, Float: posY, Float: posZ, vehID; vehID = GetPlayerVehicleID( target ); GetPlayerPos( target, posX, posY, posZ ); // Aici verifi daca jucatorul se afla intr-un vehicul if( IsPlayerInAnyVehicle( target ) ) { // Aici verifici daca vehiculul jucatorului nu are nici un loc liber if( GetFreeSeat( vehID ) == -1 ) SetPlayerPos( playerid, posX, posY + 2, posZ ); // Aici iti setezi pozitia la coordonatele jucatorului else PutPlayerInVehicle( playerid, vehID, GetFreeSeat( vehID ) ); // Aici iti setezi pozitia in vehiculul jucatorului } else SetPlayerPos( playerid, posX, posY + 2, posZ ); return true; }
    1 point
  4. Octavian

    Recomandare youtuberi

    Swifygamingro 10 e
    1 point
  5. ce p*m ii aici? *cenzurez pt ca frustratii ca essex au motiv de warn*
    0 points
  6. keNN.

    [REZOLVAT] TIMER!

    Bravo coaie.
    0 points
  7. Sapphire

    Avatar

    Dai si tu niste bani daca ai asa preferinte.
    0 points
  8. Leonard

    Phrase 3X

    Repede te-ai razgandit ???? Topic locked.
    0 points
  9. fac reclama la pocaria mea de site
    -1 points
This leaderboard is set to Bucharest/GMT+02:00
×
×
  • Create New...