Dialog Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog Help (
/showthread.php?tid=365714)
Dialog Help -
Akcent_Voltaj - 03.08.2012
hi i got an issue i get 3 errors...
PHP код:
if( dialogid == Dialog_Arme ) //caca
{
new ammo = strval(tmp);
new mod2 = 100;
new gun;
new guncharge;
new ammocharge;
if( response )//daca apasa primul buton
{
if( listitem == 0 ) // parachute
{
gun = 46;
guncharge = GunPrice[0][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 1 ) //golfclub
{
gun = 2;
guncharge = GunPrice[1][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 2 )
{
gun = 3;
guncharge = GunPrice[2][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 3 )
{
gun = 5;
guncharge = GunPrice[4][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 4 )
{
gun = 6;
guncharge = GunPrice[5][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 5 )
{
gun = 7;
guncharge = GunPrice[6][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 6 )
{
gun = 10;
guncharge = GunPrice[7][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 7 )
{
gun = 11;
guncharge = GunPrice[8][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 8 )
{
gun = 12;
guncharge = GunPrice[9][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 0 )
{
gun = 13;
guncharge = GunPrice[10][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 10 )
{
gun = 14;
guncharge = GunPrice[11][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 11 )
{
gun = 15;
guncharge = GunPrice[12][0]/100*mod2;
ammocharge = 0;
}
if( listitem == 12 )
{
gun = 23;
guncharge = GunPrice[13][0]/100*mod2;
ammocharge = GunPrice[31][0]*ammo;
}
if( listitem == 13 )
{
gun = 24;
guncharge = GunPrice[15][0]/100*mod2;
ammocharge = GunPrice[32][0]*ammo;
}
if( listitem == 14 )
{
gun = 29;
guncharge = GunPrice[18][0]/100*mod2;
ammocharge = GunPrice[28][0]*ammo;
}
if( listitem == 15 )
{
gun = 25;
guncharge = GunPrice[19][0]/100*mod2;
ammocharge = GunPrice[27][0]*ammo;
}
if( listitem == 16 )
{
gun = 30;
guncharge = GunPrice[22][0]/100*mod2;
ammocharge = GunPrice[29][0]*ammo;
}
if( listitem == 17 )
{
gun = 31;
guncharge = GunPrice[23][0]/100*mod2;
ammocharge = GunPrice[29][0]*ammo;
}
if( listitem == 18 )
{
gun = 33;
guncharge = GunPrice[24][0]/100*mod2;
ammocharge = GunPrice[30][0]*ammo;
}
if( listitem == 19 )
{
gun = 34;
guncharge = GunPrice[25][0]/100*mod2;
ammocharge = GunPrice[36][0]*ammo;
}
if( listitem == 20 )
{
gun = 32;
guncharge = GunPrice[16][0]/100*mod2;
ammocharge = GunPrice[35][0]*ammo;
}
if( listitem == 21 )
{
gun = 28;
guncharge = GunPrice[17][0]/100*mod2;
ammocharge = GunPrice[35][0]*ammo;
}
if( listitem == 22 )
{
gun = 27;
guncharge = GunPrice[20][0]/100*mod2;
ammocharge = GunPrice[34][0]*ammo;
}
if( listitem == 23 )
{
gun = 26;
guncharge = GunPrice[21][0]/100*mod2;
ammocharge = GunPrice[33][0]*ammo;
}
if( listitem == 24 )
{
Error= gun = 22;
Error= guncharge = GunPrice[14][0]/100*mod2;
Error= ammocharge = GunPrice[26][0]*ammo;
}
}
}
PHP код:
warning 204: symbol is assigned a value that is never used: "ammocharge"
warning 204: symbol is assigned a value that is never used: "guncharge"
warning 204: symbol is assigned a value that is never used: "gun"
Re: Dialog Help -
TaLhA XIV - 03.08.2012
These are warnings and they don't matter at all.They would not harm the script.
Re: Dialog Help -
Akcent_Voltaj - 03.08.2012
yeah but i dont like it...its something bothering script...why do i get warnings?
Re: Dialog Help -
A7X_CEEJAY - 03.08.2012
Let's break down these warnings for you
pawn Код:
warning 204: symbol is assigned a value that is never used: "ammocharge"
warning 204: symbol is assigned a value that is never used: "guncharge"
warning 204: symbol is assigned a value that is never used: "gun"
Okay so I'll examine the first one.
pawn Код:
warning 204: symbol is assigned a value that is never used: "ammocharge"
We first can establish, it is a warning from:
We can then realize it's telling us something about a SYMBOL(Unknown currently) is assigned a value, but it's not used from this;
PHP код:
symbol is assigned a value that is never used
If we look even closer, we can see it is caused by..?
In simple term: Your "ammocharge", "guncharge" and "gun" variables are doing nothing.
NOTE: I used PHP tags to make it stand out more.
Re: Dialog Help -
Akcent_Voltaj - 03.08.2012
so what can i do?
Re: Dialog Help -
A7X_CEEJAY - 03.08.2012
Quote:
Originally Posted by Akcent_Voltaj
so what can i do?
|
Go over your code and see why it's not working.
I'm too tired at the moment to look.
Re: Dialog Help -
milanosie - 03.08.2012
REMOVED
Re: Dialog Help -
TaLhA XIV - 03.08.2012
It is working but it is just giving a warning and I also have many scripts having the same error but the are working gine with not errors so carry on.
Re: Dialog Help -
Akcent_Voltaj - 04.08.2012
i dont like to have warning please help
Re: Dialog Help -
Devilxz97 - 04.08.2012
that means ,
Код:
ammocharge , guncharge, gun
is not use ;