SA-MP Forums Archive
Please 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: Please Help. (/showthread.php?tid=297587)



Please Help. - Hattrick - 16.11.2011

Hello,
Maybe someone can fix this script?
When I have entered a name and clicked "Give", nothing happens. What's wrong in this script?
I'm sorry for poor English. I hope someone will help.

Код HTML:
if(dialogid == Duoti)
{
ShowPlayerDialog(playerid, AtiduotiNama, DIALOG_STYLE_INPUT, "{FF0000}Agency","{66FF00}Enter the name of the man you want to give away a house.","Give","Exit");
return 1;
}
Код HTML:
if(dialogid == AtiduotiNama)
{
if(response)
{
new hname[MAX_PLAYER_NAME], msg[128], file[128];
if(!strcmp(houseDB[GetPlayerVirtualWorld(playerid)][owner_name],"no",true)) return ShowPlayerDialog(playerid, NamasNeJusu, DIALOG_STYLE_MSGBOX, "{FF0000}Agency","{66FF00}This house is not your.","Ok","");

if(!strlen(inputtext)) return ShowPlayerDialog(playerid, AtiduotiNama, DIALOG_STYLE_INPUT, "{FF0000}Agency","{66FF00}Enter the name of the man you want to give away a house.","Give","Exit");

if(!IsPlayerConnected(strval(inputtext))) return ShowPlayerDialog(playerid, AtiduotiNama, DIALOG_STYLE_INPUT, "{FF0000}Agency","{66FF00}Enter the name of the man you want to give away a house.","Give","Exit");

GetPlayerName(strval(inputtext),hname,sizeof(hname));

format(msg,sizeof(msg),"{66FF00}You have given, {FF0000}%s{66FF00}, a house.",hname);
ShowPlayerDialog(playerid, NamasAtiduotas, DIALOG_STYLE_MSGBOX, "{FF0000}Agency",msg,"Ok","");

strmid(houseDB[GetPlayerVirtualWorld(playerid)][owner_name],hname,0,MAX_PLAYER_NAME,MAX_PLAYER_NAME);

strmid(houseDB[GetPlayerVirtualWorld(playerid)][owner_name],hname,0,MAX_PLAYER_NAME,MAX_PLAYER_NAME);
format(file,sizeof(file),"saves/house/%i",GetPlayerVirtualWorld(playerid));
if(!fexist(file)) dini_Create(file);
dini_Set(file,"owner_name",hname);

format(msg,sizeof(msg),"{FFFFFF}House number {00FF00}%i{FFFFFF}\nHouse Purchase!\nOwner:{FF0000} %s",GetPlayerVirtualWorld(playerid),houseDB[GetPlayerVirtualWorld(playerid)][owner_name]);
Update3DTextLabelText(houseDB[GetPlayerVirtualWorld(playerid)][housetext],WHITE,msg);

SavePlayerData(playerid, false);
return 1;
}
}
}



Re: Please Help. - Daddy Yankee - 16.11.2011

I think the dialog id have to be numeric and unique. Did you define AtiduotiNama ? If not then put something like #define AtiduotiNama 1000; in the defines area (where other stuff is defined)


Re: Please Help. - Hattrick - 16.11.2011

Yes, it is. I get a dialog, but when i input a name to it, nothing happens.