Jump to content

Recommended Posts

Posted

Iti da eroare pentru ca ai definit TaxiCars in interiorul #if defined FILTERSCRIPT si daca nu ai #define FILTERSCRIPT (ceea ce nu ai) acel new TaxiCars[3]; va fi ignorat

#include <a_samp>
new TaxiCars[3];
new TaxiCP[MAX_PLAYERS];

main() {}

public OnGamemodeInit()
{
  // TaxiCars[0] = ....
}

 

Posted
6 minutes ago, Banditul said:

Iti da eroare pentru ca ai definit TaxiCars in interiorul #if defined FILTERSCRIPT si daca nu ai #define FILTERSCRIPT (ceea ce nu ai) acel new TaxiCars[3]; va fi ignorat

#include <a_samp>
new TaxiCars[3];
new TaxiCP[MAX_PLAYERS];

main() {}

public OnGamemodeInit()
{
  // TaxiCars[0] = ....
}

 

mersi ! +1

Posted
20 minutes ago, Banditul said:

Iti da eroare pentru ca ai definit TaxiCars in interiorul #if defined FILTERSCRIPT si daca nu ai #define FILTERSCRIPT (ceea ce nu ai) acel new TaxiCars[3]; va fi ignorat

#include <a_samp>
new TaxiCars[3];
new TaxiCP[MAX_PLAYERS];

main() {}

public OnGamemodeInit()
{
  // TaxiCars[0] = ....
}

 

Dar mai primesc o eroare! ideea este ca nu stiu daca am pus bine semnul "sau" ! Ar fi super daca  ati putea sa imi spuneti cum o pun ! Pe Shift + F7 Nu imi merge !
https://imgur.com/a/YIfLuUD

Posted

Cum am spus, acel #if defined este un un bloc (care nu are paranteze pentru limitare ceea ce poate crea putina confuzie ) si atat timp cat nu exista #define FILTERSCRIPT inaintea lui va ignora ce se afla pana la #else/#endif

#if defined FILTERSCRIPT
new ijswfsfwerf; // Sunt ignorate la compilare
new iaofjwuiefsfs;
// Orice cod care se afla aici
// Va fi ignorat daca inainte de
// #if defined FILTERSCRIPT nu exista #define FILTERSCRIPT
#endif
new Masina[2]; // Orice e pus dupa #endif va fi compilat si rulat

Am oferit un simplu exemplu care nu cred ca este prea avansat cat sa nu poata fi reprodus (era mai usor daca codul oferit era in text si intr-o imagine dar nu asta e important)

#include <a_samp>

new TaxiCars[3];
new TaxiCP[MAX_PLAYERS];

main()
{
    print("Infinity Gamemode");
}

public OnGameModeInit()
{
    TaxiCars[0] = CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren=0);
    TaxiCars[1] = CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren=0);
    TaxiCars[2] = CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren=0);
    SetGameModeText("Gamemode Infinity");
    AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
}

Nu este nevoie de altceva, acel #if defined FILTERSCRIPT  OnFilterScriptInit()/OnFilterScriptExit() nu sunt necesare si pot sterse

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.