How to make this?
#1

Hello all.

Well...
A part of OnPlayerConnect
pawn Код:
ShowRules(playerid);
SetTimer("HideRules", RulesTime*1000, false);
SetTimer("ShowRegisterLogin", RulesTime*1000, false);
I want to know how to make something like a timer,so i can call OnPlayerReuestClass after the player logs in, but how to make that?
Reply
#2

Under onplayerconnect, instead of returning 1;, return 0;

then after a player logins in, call "OnPlayerRequestClass(first_class_id_you_want_firs t);" (0 mostly)
Reply
#3

Quote:
Originally Posted by Donya
Посмотреть сообщение
return 0; under onplayerconnect, onplayerlogin, call OnPlayerRequestClass(playerid, class_id_u_want_first);
Didnt understand anything...
Thanks for helping anyway.
Reply
#4

read it again
Reply
#5

Okay, ill try that.

EDIT: Cant i just use OnPlayerRequestClass(playerid, classid); ?
Reply
#6

He helped you.

Use:

Код:
OnPlayerConnect(playerid);
{
return 0;
}
And In you Log in code add:

Код:
 OnPlayerRequestClass(playerid,classid);
Reply
#7

u have to put a classid......... 0 - thenumberofclasses u have
Reply
#8

Quote:
Originally Posted by Markx
Посмотреть сообщение
Okay, ill try that.

EDIT: Cant i just use OnPlayerRequestClass(playerid, classid); ?
No, you can't , because when you try to do this, the OnPlayerRequestClass(playerid, classid) is called like a normal callback, in other words, only the code that is inside it will works, like :



pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SendClientMessage(playerid,0xFFFFFFAA,"OnPlayerRequestClass was called :D !");
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/test", cmdtext, true, 5))
    {
        CallLocalFunction("OnPlayerRequestClass","d",playerid);//Calls the OnPlayerRequestClass, but only the SendClientMessage code that is inside its will work. The selection of chars, teams and etc will won't appear :p.
        return 1;
    }
    return 0;
}


Well, i did a function to you, it should solve your problem :


pawn Код:
#define RequestClassForPlayer(%0);  ForceClassSelection(%0),SetPlayerHealth(%0,0),SpawnPlayer(%0);

I hope that i have helped .
Reply
#9

actually calling OnPlayerRequestClass(playerid, classid) raw can work. if u havent spawned yet lol..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)