automatic cmd?
#1

how to make an automatic cmd like when a player connects execute command from him /login
Reply
#2

Zcmd:
pawn Код:
cmd_login(playerid,"");
Reply
#3

I didn't understand what you asked really. I hope it might be kinda this:
You can use the callback "OnPlayerConnect" which gets called when a player get connected.
pawn Код:
public OnPlayerConnect(playerid)
{
  //Your code here.
 return 1;
}
.
Reply
#4

@ LordZ i know that but code should that be?
Reply
#5

i will rep
Reply
#6

I'm sorry, I can't understand what you're saying. :/
Reply
#7

He wants to know how to execute a command when a player connects. It's not that hard to understand...

If you're using something like ZCMD, you need to do this:
pawn Код:
public OnPlayerConnect(playerid)
{
    cmd_login(playerid, "");
    return 1;
}
Otherwise, you can just copy and paste code from the command.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/login", true) == 0)
    {
        mycodehere1;
        mycodehere2;
        mycodehere3;
    }
    return 0;
}
You need to copy and paste that into your OnPlayerConnect. (NOT CUT!)

pawn Код:
OnPlayerConnect(playerid)
{
    mycodehere1;
    mycodehere2;
    mycodehere3;
    return 1;
} //mycodehere is just for example, not actual functioning code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)