how can i define this
#7

Quote:
Originally Posted by Lucases
Посмотреть сообщение
You mean calling "OnPlayerClickPlayer" callback inside a dialog?
I don't think that's possible because this callback gets called when someone clicks on a player in TAB
Actually it is possible but i dont see any reason to use this

PHP код:
#include <a_samp>
#include <izcmd>
IsNumeric(const string[])
{
    for(new 
0strlen(string); i++)
    {
        if(
string[i] < '0' || string[i] > '9') return 0;
    }
    return 
1;
}
CMD:clickp(playeridparams[])
{
    
ShowPlayerDialog(playerid0DIALOG_STYLE_INPUT"{FFFFFF}Click on player""{FFFFFF}Choose the id of the player that you want to click:""Click""Cancel");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
0:
        {
            switch(
response)
            {
                case 
1:
                {
                    if(!
IsNumeric(inputtext)) return ShowPlayerDialog(playerid0DIALOG_STYLE_INPUT"{FFFFFF}Click on player""{FFFFFF}Invalid number""Click""Cancel");
                    if(!
IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid0xFF0000FF"Invalid playerid");
                    
OnPlayerClickPlayer(playeridstrval(inputtext), -1);
                }
            }
        }
    }
    return 
0;
}
public 
OnPlayerClickPlayer(playeridclickedplayeridsource)
{
    new 
name[24], name2[24], str[41], str2[40];
    
GetPlayerName(playeridnamesizeof(name));
    
GetPlayerName(clickedplayeridname2sizeof(name2));
    
format(strsizeof(str), "You clicked on: %s"name2);
    
format(str2sizeof(str2), "%s clicked on you"name);
    
SendClientMessage(playerid, -1str);
    
SendClientMessage(clickedplayerid, -1str2);
    return 
1;

Reply


Messages In This Thread
how can i define this - by RoyalEmpire - 01.11.2017, 16:32
Re: how can i define this - by Abagail - 01.11.2017, 16:39
Re: how can i define this - by RoyalEmpire - 01.11.2017, 16:43
Re: how can i define this - by billy1337samp - 01.11.2017, 16:54
Re: how can i define this - by RoyalEmpire - 01.11.2017, 17:04
Re: how can i define this - by Lucases - 02.11.2017, 10:10
Re: how can i define this - by Lokii - 02.11.2017, 11:59
Re: how can i define this - by RoyalEmpire - 02.11.2017, 12:37

Forum Jump:


Users browsing this thread: 2 Guest(s)