14.05.2018, 20:27
PHP код:
#define scm SendClientMessage
enum{
d_deathmsg
};
public OnPlayerDeath(playerid, killerid, reason) {
ShowPlayerDialog(killerid, d_deathmsg, DIALOG_STYLE_INPUT, "Simple question for you", "Are you smart?", "Ok", "");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
new pid=playerid;
switch(dialogid){
case d_deathmsg:{
//must answer, cant be closed with pressing ESC
if(strlen(inputtext) < 5)
return scm(pid,-1,"Text must be longer then 5 letters!"),
ShowPlayerDialog(killerid, d_deathmsg, DIALOG_STYLE_INPUT, "Simple question for you", "Are you smart?", "Ok", "");
for(new i,i2=strlen(inputtext); i < i2; i++){
if(!('a' <= inputtext[i] <= 'z'))
return scm(pid,-1,"Only letters are allowed!"),
ShowPlayerDialog(killerid, d_deathmsg, DIALOG_STYLE_INPUT, "Simple question for you", "Are you smart?", "Ok", "");
}
//your other code
}
}
return 1;
}