how can i define this
#1

hey guys i need your help in this
how can i use this
return OnPlayerClickPlayer
how i can return this
Reply
#2

You can simply use the return function if you want to get the return value or you can use CallLocalFunction to just call it.
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
You can simply use the return function if you want to get the return value or you can use CallLocalFunction to just call it.
can u give me example with onplayerclickplayer pls
Reply
#4

Код:
public OnPlayerClickPlayer(playerid,clickerplayerid,source)
{
  return 1;
}
Reply
#5

Quote:
Originally Posted by billy1337samp
Посмотреть сообщение
Код:
public OnPlayerClickPlayer(playerid,clickerplayerid,source)
{
  return 1;
}
how can i get this function with this if i want this in any dialog
return Onplayerclickplayer; not works
Reply
#6

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
Reply
#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
#8

thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)