Jump to content

Recommended Posts

Posted

Salut, astăzi am creat o nouă librărie, librăria aceasta iţi permite să iei culoarea, numarul de înmatriculare și aduce în plus 2 callback-uri noi.

Lista funcțiilor

  • GetVehicleColor( vehicleid, &color1, &color2 );
  • SetVehicleColor( vehicleid );
  • SetVehicleNumberPlate( vehicleid, szPlate[ ] );
  • GetVehicleNumberPlate( vehicleid );
  • public OnVehicleUpdate( vehicleid )
  • public OnVehicleCreated( vehicleid )

Exemple

//Exemplul numarul 1.
public OnPlayerEnterVehicle( playerid, vehicleid )
{
    new Color[ 2 ];//Creez o matrice cu 2 randuri.
    GetVehicleColor( vehicleid, Color[ 0 ], Color[ 1 ] ); //Iau culorile masini.
    printf( "Masina %d are culorile %d, %d", vehicleid, Color[ 0 ], Color[ 1 ] );// Trimit un    mesaj sa vad daca s-au luat culorile.
    return 1;
}

//Exemplul numarul 2.
public OnPlayerEnterVehicle( playerid, vehicleid )
{
    SetVehicleColor( vehicleid, random( 255 ), random( 255 ) );// Setez culoarea masini cand jucatorul intra in ea.
    return 1;
}

//Exemplul numarul 3.
public OnPlayerEnterVehicle( playerid, vehicleid )
{
    SetVehicleNumberPlate( vehicleid, "Numar");// Setez numarul masini cand jucatorul intra in ea.
    return 1;
}

//Exemplul numarul 4.
public OnPlayerEnterVehicle( playerid, vehicleid )
{
    printf( "Masina %d are numarul %s", vehicleid, GetVehicleNumberPlate( vehicleid ) );// Setez numarul masini cand jucatorul intra in ea.
    return 1;
}
//Exemplul numarul 5.
public OnVehicleCreated( vehicleid )
{
    new Colors[ 2 ], szPlate[ 17 ];// Creez 2 variabile
    GetVehicleColor( vehicleid, Colors[ 0 ], Colors[ 1 ] );//Iau culorile masini
    format( szPlate, 17, "LS-%d", vehicleid );//Formatez string-ul szPlate
    SetVehicleNumberPlate( vehicleid, szPlate );//Setez numarul masini
    printf( "Vehicle: %d || Colors: %d, %d || Plate: %s", vehicleid, Colors[ 0 ], Colors[ 1 ], GetVehicleNumberPlate( vehicleid ) );//Trimit un mesaj in consola cu datele pe care le-am luat.
    return 1;
}
//Exemplul numarul 6.
public OnVehicleUpdate( vehicleid )
{
    ChangeVehicleColor( vehicleid, random( 255 ), random( 255 ) );// Setez culori random cand masina acceseaza functia.
    return 1;
}

Download
- Pastebin
- Solidfiles

  • Upvote 3

I'm back bitches.

  • 6 months later...
Posted

Deabea acum am găsit și eu acest include.

 

L-am implementat la mine pe server și îți spun cu sinceritate că îți mulțumesc foarte mult pentru el.

 

10/10, foarte frumos.

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.