HOW TO DO THIS
#1

How i can make when player click on cancel in dialog give another reason For Ex


Someone(1) Has left the server (Leaving)


how i can do this its always say Kicked
Reply
#2

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    new
        
string[64],
        
name[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(
reason)
    {
        case 
0format(string,sizeof string,"%s left the server. (Timed out)",name);
        case 
1format(string,sizeof string,"%s left the server. (Leaving)",name);
        case 
2format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
    }
    
SendClientMessageToAll(0xFFFFFFAA,string);
    return 
1;

Note: Copied from wiki!

https://sampwiki.blast.hk/wiki/OnPlayerDisconnect
Reply
#3

i know this i got them all in my script but what i want when player click on Quit in dialog show him like that message


%s left the server. (Leaving)
Reply
#4

Only if you script it personally or try
PHP код:
//OnDialogResponse
if(!respondOnPlayerCommandText(playerid,"/q"); 
Just not sure can you call default sa-mp commands :/
Reply
#5

Its not work stay tell me unknown command
Reply
#6

you cant close the players client... the max you can do is kick the player and force him to quit.
Reply
#7

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
you cant close the players client... the max you can do is kick the player and force him to quit.
And that won't give him effect he wants.

@Max, create variable for player and then if he responded quit you will send message that he left, else you would send message Kicked

EDIT: SOmething like this.
NOTE: UNTESTED
PHP код:
//top of the script
new bool:Quited[MAX_PLAYERS];
public 
OnPlayerDisconnect(playeridreason)
{
    new
        
string[64],
        
name[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(
reason)
    {
        case 
0format(string,sizeof string,"%s left the server. (Timed out)",name);
        case 
1format(string,sizeof string,"%s left the server. (Leaving)",name);
        case 
2:
        {
            if(
Quited[playerid] == true)
            {
                
format(string,sizeof string,"%s left the server. (Leaving)",name);
            }
            else 
format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
        }
    }
    
SendClientMessageToAll(0xFFFFFFAA,string);
    return 
1;
}
//OnDialogResponse
if(!reason)
{
    
Quited[playerid] = true;
    
Kick(playerid);
    return 
1;

Reply
#8

Thanks man its fucking work man thank you very much you are very nice!! i give you repuation
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)