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; }
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. |
What do you want to do anyways? Why do you check the index 30 of deger if it's equal to 1?
|
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.
|