DIALOG_STYLE_INPUT input text - 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_STYLE_INPUT input text (
/showthread.php?tid=638324)
DIALOG_STYLE_INPUT input text -
grymtn - 30.07.2017
hello friends i have problem with inputtexts i really cant use it
heres my code
Код:
case 2455: {
new puttext;
format(puttext,1,inputtext);
new i = GetPVarInt(playerid,"playerVehID");
if(strval(puttext)=="1")
{
if(vInfo[i][vehGun1]==0)
{
vInfo[i][vehGun1]=USER[playerid][GUN1];
vInfo[i][vehAmmo1]=USER[playerid][AMMO1];
USER[playerid][GUN1]=0;
USER[playerid][AMMO1]=0;
}
if(vInfo[i][vehGun2]==0)
{
vInfo[i][vehGun2]=USER[playerid][GUN1];
vInfo[i][vehAmmo2]=USER[playerid][AMMO1];
USER[playerid][GUN1]=0;
USER[playerid][AMMO1]=0;
}
if(vInfo[i][vehGun3]==0)
{
vInfo[i][vehGun3]=USER[playerid][GUN1];
vInfo[i][vehAmmo3]=USER[playerid][AMMO1];
USER[playerid][GUN1]=0;
USER[playerid][AMMO1]=0;
}
}
if(strval(puttext)=="2")
{
if(vInfo[i][vehGun1]==0)
{
vInfo[i][vehGun1]=USER[playerid][GUN2];
vInfo[i][vehAmmo1]=USER[playerid][AMMO2];
USER[playerid][GUN2]=0;
USER[playerid][AMMO2]=0;
}
if(vInfo[i][vehGun2]==0)
{
vInfo[i][vehGun2]=USER[playerid][GUN2];
vInfo[i][vehAmmo2]=USER[playerid][AMMO2];
USER[playerid][GUN2]=0;
USER[playerid][AMMO2]=0;
}
if(vInfo[i][vehGun3]==0)
{
vInfo[i][vehGun3]=USER[playerid][GUN2];
vInfo[i][vehAmmo3]=USER[playerid][AMMO2];
USER[playerid][GUN2]=0;
USER[playerid][AMMO2]=0;
}
}
if(strval(puttext)=="3")
{
if(vInfo[i][vehGun1]==0)
{
vInfo[i][vehGun1]=USER[playerid][GUN3];
vInfo[i][vehAmmo1]=USER[playerid][AMMO3];
USER[playerid][GUN3]=0;
USER[playerid][AMMO3]=0;
}
if(vInfo[i][vehGun2]==0)
{
vInfo[i][vehGun2]=USER[playerid][GUN3];
vInfo[i][vehAmmo2]=USER[playerid][AMMO3];
USER[playerid][GUN3]=0;
USER[playerid][AMMO3]=0;
}
if(vInfo[i][vehGun3]==0)
{
vInfo[i][vehGun3]=USER[playerid][GUN3];
vInfo[i][vehAmmo3]=USER[playerid][AMMO3];
USER[playerid][GUN3]=0;
USER[playerid][AMMO3]=0;
}
}
I am really lost. Any help is appreciated.
Re: DIALOG_STYLE_INPUT input text -
Kane - 30.07.2017
What's the problem and why're you formatting inputtext into a new variable when you could just use inputtext?
Re: DIALOG_STYLE_INPUT input text -
Shinja - 30.07.2017
You are declaring puttext as an integer, and your format it as a string,
you will get error "tag mismatch"
And yeah why you create a new variable, you can just use inputtext
or fix by making puttext a string