Public Help
#1

public deger values ​​does not work help!!


Код:
Antiopen(playerid,"ANTI_CRASHER","Anti_Crasher","Anti Crasher","Anti Crasher"); // Deger is "ANTI_CRASHER"
Код:
forward Antiopen(playerid,deger[],const dini[],const turkce2[], const english2[]);
public Antiopen(playerid,deger[],const dini[],const turkce2[],const english2[])
{
	new str[100],file[256],string[144],string2[144];
    PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
    if(deger[30] == 1){ // value does not work
    #if LANGUAGE == 0
	format(string, sizeof(string), "%s Zaten Aktif.",turkce2);
    return Hatatr(playerid,string);
    #elseif LANGUAGE == 1
	format(string, sizeof(string), "%s Already Active.",english2);
    return Hataen(playerid,string);
    #endif
    }
    deger[30] = 1; // value does not work
    #if MYSQL_KAYIT == true
    MySQLguncelle(),MySQLguncelle2();
    #elseif NORMAL_KAYIT == true
    format(str,sizeof(str),"%s",dini);
    format(file,sizeof(file),"Anti_Hile/Ayarlar.ini");
    dini_IntSet(file,str,1);
    #endif
    #if LANGUAGE == 0
	format(string2, sizeof(string2), "%s Başarıyla Aktif Edildi.", turkce2);
    Bilgitr(playerid,string2);
    #elseif LANGUAGE == 1
	format(string2, sizeof(string2), "%s Has Been Succesfully Activated.", english2);
    Bilgien(playerid,string2);
    #endif
    return 1;
}
Reply
#2

Bump #1
Reply
#3

Quote:
Originally Posted by eco1999
Посмотреть сообщение
public deger values ​​does not work help!!


Код:
Antiopen(playerid,"ANTI_CRASHER","Anti_Crasher","Anti Crasher","Anti Crasher"); // Deger is "ANTI_CRASHER"
Код:
forward Antiopen(playerid,deger[],const dini[],const turkce2[], const english2[]);
public Antiopen(playerid,deger[],const dini[],const turkce2[],const english2[])
{
	new str[100],file[256],string[144],string2[144];
    PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
    if(deger[30] == 1){ // value does not work
}
That's understandable.

You're passing a string to your function: "ANTI_CRASHER".
This string is only 12 characters long.

Your code "if (deger[30] == 1" checks the 30th character to be equal to integer value "1".
Deger has been initialized with only size 13 (your string and NULL character) and you try to access character 30, which gives you an out-of-bounds error.
Reply
#4

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
That's understandable.

You're passing a string to your function: "ANTI_CRASHER".
This string is only 12 characters long.

Your code "if (deger[30] == 1" checks the 30th character to be equal to integer value "1".
Deger has been initialized with only size 13 (your string and NULL character) and you try to access character 30, which gives you an out-of-bounds error.
That's why I made it available in different use

Sample

Antiopen(playerid,"ANTI_CRASHER","Anti_Crasher","A nti Crasher","Anti Crasher");
Antiopen(playerid,"ANTI_CON","Anti_Con","Anti Con","Anti Con");
Antiopen(playerid,"ANTI_PING","Anti_Ping","Anti Ping","Anti Ping");
Antiopen(playerid,"ANTI_SILAH","Anti_Silah","Anti Silah","Anti Weapon");
Reply
#5

What do you want to do anyways? Why do you check the index 30 of deger if it's equal to 1?
Reply
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
What do you want to do anyways? Why do you check the index 30 of deger if it's equal to 1?
I want to do public work
Reply
#7

Bump #2
Reply
#8

Quote:
Originally Posted by eco1999
Посмотреть сообщение
I want to do public work
What you're saying makes no sense and so the code does. What "public work" is supposed to be? By checking a random index from a string (array) is useless and as PowerPC603 already said can cause run time error: Array index out of bounds.
Reply
#9

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
What you're saying makes no sense and so the code does. What "public work" is supposed to be? By checking a random index from a string (array) is useless and as PowerPC603 already said can cause run time error: Array index out of bounds.
I wonder how I can do.Would you do the make code.
Reply
#10

Bump #3

Bump #4

Bump #5
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)