SA-MP Forums Archive
Cookies - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Cookies (/showthread.php?tid=583054)



Cookies - ShoortyFl - 25.07.2015

Having trouble with this, this is not actually a problem, but when i connect it freezes me at
Код:
[0.3.7] Connected to Server Name
And after 5-10 seconds it calls on player connect


Код:
[16:03:28] [connection] 127.0.0.1:49153 requests connection cookie.
[16:03:29] [connection] incoming connection: 127.0.0.1:49153 id: 0
[16:03:30] [join] Joan_Mackey has joined the server (0:127.0.0.1)



Re: Cookies - xVIP3Rx - 25.07.2015

Do you have a lot of codes under "OnPlayerConnect" or "OnIncomingConnection", also does this happen to you only or everybody trying to join, is the server on the same computer or a different one ?


Re: Cookies - ShoortyFl - 25.07.2015

This is my onplayerconnect

pawn Код:
public OnPlayerConnect(playerid)
{
    TogglePlayerSpectating(playerid, true);

    ClearChat(playerid, 40);
    SCM(playerid, GREEN, "Loading server, please wait...");
    new ransd = random(12000);
    SetTimerEx("SetCameras", 1000+(ransd), false, "d", playerid);
    return 1;
}

public SetCameras(playerid)
{
    ClearChat(playerid, 40);
    SCM(playerid, GREEN, "You are connected to the Server...");

    new Ime[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Ime, sizeof(Ime));

    InterpolateCameraPos(playerid, 705.324035, -1372.906738, 36.416351, 837.963317, -1142.538208, 110.680702, 7000);
    InterpolateCameraLookAt(playerid, 702.588439, -1368.721679, 36.463542, 841.221801, -1138.922973, 109.535041, 700);
    return 1;
}
When i connect it gives me the Server loading, please wait message, and secs after that it brings up that default message, [0.3.7] Connected to Server Name, and after few seconds it switchs to the timer to set cameras


Re: Cookies - xVIP3Rx - 26.07.2015

pawn Код:
new ransd = random(12000);
    SetTimerEx("SetCameras", 1000+(ransd), false, "d", playerid);
This sets the camera after a random between zero and 12 seconds, that's why it's taking time to set cameras, decrease or remove it..