02.09.2015, 08:46
Hello there! I have created my own admin filterscript and I am using OnDialogResponse. But it is not working!
OnDialogResponse:
My server.cfg:
Can you help me? Why OnDialogResponse isn't working?
OnDialogResponse:
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid){
case DIALOG_LOG:{
if(!response)return Kick(playerid);
if(strcmp(inputtext,P_DATA[playerid][password],true))return ShowPlayerDialog(playerid,DIALOG_LOG,DIALOG_STYLE_PASSWORD,"{FF0000}Login Error","{FF0000}Wrong password!\n\n\n{FFFFFF}Try again:","Login","Quit");
Login(playerid);
return 1;
}
case DIALOG_REG:{
if(!response)return Kick(playerid);
if(strlen(inputtext) == 0)return ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_PASSWORD,"{FF0000}Register","{FFFFFF}Welcome to our server for the first time!\nType your new password to register an account!","Register","Quit");
new name[MAX_PLAYER_NAME],q[256],DBResult:Res;
GetPlayerName(playerid,name,sizeof(name));
format(q,sizeof(q),"INSERT INTO Account (username,password) VALUES ('%s','%s')",name,inputtext);
Res = db_query(database,q);
db_free_result(Res);
return 1;
}
}
if(dialogid == SERVER_RADIO)
{
if(response)
{
switch(listitem)
{
case 0: PlayAudioStreamForPlayer(playerid, "http://download1345.mediafire.com/51za8dqgc8eg/4h6ont19u4xkmah/Dillon+Francis%2C+DJ+Snake+-+Get+Low.mp3");
case 1: StopAudioStreamForPlayer(playerid);
}
}
return 1;
}
return 1;
}
Код:
echo Executing Server Config... lanmode 0 hostname Greek Gaming Land | Ultra-H.com weburl gamingland.forumgreek.com mapname San Andreas language Greek - English password rcon_password 123 maxplayers 20 bind 94.23.208.199 port 2488 maxnpc 0 rcon 1 announce 1 query 1 lagcompmode 1 messageholelimit 3000 messageslimit 500 ackslimit 3000 gamemode0 new filterscripts UltraHost CarTune key2 CAdmin plugins crashdetect.so sscanf.so streamer.so audio.so whirlpool.so onfoot_rate 40 incar_rate 40 weapon_rate 40 stream_distance 300.0 stream_rate 1000