Jump to content

Salut ! Cine ma poate ajuta cu erorile astea ?


GamerulFOX

Recommended Posts

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] = ....
}

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.