OnPlayerDeath && ShowPlayerDialog issue
#2

PHP код:
#define scm SendClientMessage
enum{
    
d_deathmsg
};
public 
OnPlayerDeath(playeridkilleridreason) { 
    
ShowPlayerDialog(killeridd_deathmsgDIALOG_STYLE_INPUT"Simple question for you""Are you smart?""Ok"""); 
    return 
1

public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[]){
    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(killeridd_deathmsgDIALOG_STYLE_INPUT"Simple question for you""Are you smart?""Ok""");
            for(new 
i,i2=strlen(inputtext); i2i++){
                if(!(
'a' <= inputtext[i] <= 'z'))
                    return 
scm(pid,-1,"Only letters are allowed!"),
                        
ShowPlayerDialog(killeridd_deathmsgDIALOG_STYLE_INPUT"Simple question for you""Are you smart?""Ok""");
            }
            
//your other code
        
}
    }
    return 
1;

Reply


Messages In This Thread
OnPlayerDeath && ShowPlayerDialog issue - by OsmanMalagic - 14.05.2018, 18:50
Re: OnPlayerDeath && ShowPlayerDialog issue - by CodeStyle175 - 14.05.2018, 20:27

Forum Jump:


Users browsing this thread: 1 Guest(s)