if(pickupid == EnterHouse)
{
}
SendClientMessage(playerid,0xFF0000AA,"Wrong Password!");
SetPlayerPos(playerid,139.4020,1368.8059,1083.8636);
OnGameModeInIt()
{
EnterHouse = CreatePickup(Model ID, type, X, Y, Z, virtual world //By the way you can also create Dynamic one...
}
enum houseinfo
{
housepassword;
}
new HouseInfo[MAX_HOUSES][houseinfo];
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == EnterHouse)
{
ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_PASSWORD, "House Password", "Enter the house password below:", "Enter", "Close");
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1000)
{
if(!response) // That's if he pressed ESC or Cancel button.
{
SendClientMessage(playerid,0xFF0000AA,"Wrong Password!");
}
else // That's if he pressed Okay or ENTER button.
{
if(strcmp(HouseInfo[houseid][hPassword], inputtext, true, 32)
{
SetPlayerPos(playerid,139.4020,1368.8059,1083.8636);
}
else
{
SendClientMessage(playerid,0xFF0000AA,"Wrong Password!");
// Re-show the login dialog
ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_PASSWORD, "House Password", "Please enter your house password:", "Login", "Cancel");
}
}
return 1;
}
return 0;
}
C:\Users\Desktop\gm9\filterscripts\House_h.pwn(76) : error 001: expected token: "}", but found ";"
C:\Users\Desktop\gm9\filterscripts\House_h.pwn(78) : error 017: undefined symbol "MAX_HOUSES"
C:\Users\Desktop\gm9\filterscripts\House_h.pwn(444) : error 017: undefined symbol "houseid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
Thank you for your answer but, I encounter with this error when compile
|
if(strcmp(HouseInfo[houseid][hPassword], inputtext, true, 32)
{
SetPlayerPos(playerid,139.4020,1368.8059,1083.8636);
}
else
{
SendClientMessage(playerid,0xFF0000AA,"Wrong Password!");
// Re-show the login dialog
ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_PASSWORD, "House Password", "Please enter your house password:", "Login", "Cancel");
}
if(!strcmp(HouseInfo[houseid][hPassword], inputtext, true))
@JasonRiggs
PHP код:
you should check if strcmp equal to 0 PHP код:
|
I didn't give you the exact code tho, You need also to adapt it with your script, I won't feed you in mouth, If I've got to give you the full code, then what is your use??
|
I believe that you are the wrong one, As I'm checking that if the strcmp is equal to 1 then teleport the player, Else, then send the wrong password message.
|
strcmp("test", "te"); //will return 2
strcmp("test", "tes"); //will return 1
strcmp("test", "test"); //will return 0