06.06.2012, 21:09
I've had lots of problems with this tiny piece of script, the problem is that when I type the command at My house. It works but the chat is spammed for me. When i get to another person's house. This code does not work. I need some help from you guys to help me fix it.
Thanks for your time, I've spent a lot of time trying different ways to get this to work but sadly it didn't.
The script saves and loads the code perfectly. I just have a problem with this part.
PHP код:
case DIALOG_HOUSEPASSWORDENTER:
{
if(response)
{
if(strlen(inputtext) != 4)
{
ShowPlayerDialog(playerid, DIALOG_HOUSEPASSWORDENTER, DIALOG_STYLE_INPUT,""COL_YELLOW"Lock Password (Numbers Only)",""COL_WHITE"Enter The House Password","Confirm","Close");
return true;
}
for(new x = 0; x < MAX_HOUSES; x++)
{
new pName4[MAX_PLAYER_NAME];
new string41[128];
new labelString[128];
GetPlayerName(playerid, pName4, MAX_PLAYER_NAME);
if(house[x][hLockCode] == strval(inputtext))
{
switch(house[x][hHouseLocked])
{
case 1:
{
format(string41, sizeof(string41), "%s places their fingers on the keypad", pName4);
SendLocalMessage(playerid, string41, 15.0, COLOR_PURPLE, COLOR_PURPLE);
house[x][hHouseLocked] = 0;
format(labelString, sizeof(labelString), "House ID: %d\nOwner: %s\n\nPress ~k~~PED_DUCK~ to enter.", x, house[x][hHouseOwner]);
UpdateDynamic3DTextLabelText(house[x][hLabelID], COLOR_LIMEGREEN, labelString);
}
case 0:
{
format(string41, sizeof(string41), "%s places their fingers on the keypad", pName4);
SendLocalMessage(playerid, string41, 15.0, COLOR_PURPLE, COLOR_PURPLE);
house[x][hHouseLocked] = 1;
format(labelString, sizeof(labelString), "House ID: %d\nOwner: %s\n\n(Locked)", x, house[x][hHouseOwner]);
UpdateDynamic3DTextLabelText(house[x][hLabelID], COLOR_LIMEGREEN, labelString);
}
}
break;
}
else
{
format(string41, sizeof(string41), "%s places their fingers on the keypad", pName4);
SendLocalMessage(playerid, string41, 15.0, COLOR_PURPLE, COLOR_PURPLE);
PlayerActionMessage(playerid,15.0,"Incorrect Password");
}
}
}
}
The script saves and loads the code perfectly. I just have a problem with this part.