Npc Leaving after a while time ' 15 sec '
#1

OnPlayerConnect

Код:
public OnPlayerConnect(playerid)   // Quand le joueur ce connecte.
{
    if(IsPlayerRNPC(playerid))
    {
        SpawnPlayer(playerid);
    }
    else
    {
	new phrase[256];
    GetPlayerName(playerid,Nom,sizeof Nom);
    format(phrase,sizeof phrase,""C_Blanc"%s "C_BleuSamp"vient de rejoindre la ville.",Nom);
    SendClientMessageToAll(JAUNE,phrase);
    
    new Charger[35];
    new requete[32];
	GetPlayerName(playerid, Nom, sizeof(Nom));
    format(requete, sizeof(requete), "SELECT * FROM rp_compte_lier WHERE LOWER(NomJoueur)=LOWER('%s') LIMIT 1", Nom);
    mysql_query(requete);
    mysql_store_result();
    while(mysql_fetch_row_format(requete,"|"))
    {
        mysql_fetch_field_row(Charger, "PremiereCo");ConnexionOne[playerid] = strval(Charger);
	}
and this is the msg i get before the npc left :

OnplayerConnect Hook has Called
After 10 sec i get this
ARNPC Debug : OnPlayerDisconnect Hook has Called

Thank you to get me an answer
Reply
#2

pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    // rest of code
    return 1;
}
and if the type is not for vehicles, it's not necessary to use OnPlayerSpawn callback.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)