SA-MP Forums Archive
After 2 weeks, server back online, when i spawn i die ! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: After 2 weeks, server back online, when i spawn i die ! (/showthread.php?tid=263969)

Pages: 1 2


After 2 weeks, server back online, when i spawn i die ! - Michael@Belgium - 24.06.2011

SOLVED


Re: After 2 weeks, server back online, when i spawn i die ! - MAVERICKS - 24.06.2011

maybe it's a bug of a filterscript or gamemode!


Re: After 2 weeks, server back online, when i spawn i die ! - Michael@Belgium - 24.06.2011

Damn , why it's moved :-/
And no ... even i don't put filterscripts in my server.cfg. It's still don't work, so it must be in my gamemode, and the onplayerspawn of my gamemode you see above ..


Re: After 2 weeks, server back online, when i spawn i die ! - Michael@Belgium - 24.06.2011

Ow god, plz help me


Re: After 2 weeks, server back online, when i spawn i die ! - [BP]Tony - 24.06.2011

Hmm i can help but can u says the name of the gm!


Re: After 2 weeks, server back online, when i spawn i die ! - leingod - 24.06.2011

i thought that you die in real life -_-

LOL


Re: After 2 weeks, server back online, when i spawn i die ! - [BP]Tony - 24.06.2011

Quote:
Whenever you're feeling down, desperate, just remember you were the fastest sperm!

wtf
leingod


Re: After 2 weeks, server back online, when i spawn i die ! - leingod - 24.06.2011

your life now because you're the fastest sperm from your dad LOL


Re: After 2 weeks, server back online, when i spawn i die ! - Michael@Belgium - 25.06.2011

Quote:
Originally Posted by leingod
Посмотреть сообщение
i thought that you die in real life -_-

LOL
WTF xD

Quote:
Originally Posted by [BP]Tony
Посмотреть сообщение
Quote:
Whenever you're feeling down, desperate, just remember you were the fastest sperm!

wtf
leingod
Ok ...

Quote:
Originally Posted by leingod
Посмотреть сообщение
your life now because you're the fastest sperm from your dad LOL
...


ON TOPIC PLZ ! xD


Re: After 2 weeks, server back online, when i spawn i die ! - Max_Coldheart - 25.06.2011

Quote:
Originally Posted by leingod
Посмотреть сообщение
your life now because you're the fastest sperm from your dad LOL
Okay, just what the fuck?

On Topic:
Could you please show us your "OnPlayerUpdate"? Bug there could kill you, as its called almost 80 times in a second.


Re: After 2 weeks, server back online, when i spawn i die ! - Lorenc_ - 25.06.2011

pawn Code:
public OnPlayerUpdate(playerid)
{
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    if(Health < 1) return SpawnPlayer(playerid);
    return 1;
}
Try that

EDIT: I thought it was a death bug sorry!


Re: After 2 weeks, server back online, when i spawn i die ! - langricr - 25.06.2011

Try changing

Code:
SetPlayerHealth(playerid,99999);
to

Code:
SetPlayerHealth(playerid,64000);
Although I'm pretty sure its not the case, the integer you specify might be overflowing and changing into a negative number because its too high. However, since you claim its not any of the filterscripts and its the only part of the spawn code that changes the player's health, I suggest you try changing it.

Wiki: Integer Overflow


Re: After 2 weeks, server back online, when i spawn i die ! - Michael@Belgium - 25.06.2011

Quote:
Originally Posted by Max_Coldheart
View Post
Okay, just what the fuck?

On Topic:
Could you please show us your "OnPlayerUpdate"? Bug there could kill you, as its called almost 80 times in a second.
Under OnPlayerUpdate there is actually nothing just this:
pawn Code:
public OnPlayerUpdate(playerid)
{
    Streamer_Update(playerid);
    return 1;
}
Quote:
Originally Posted by Lorenc_
View Post
pawn Code:
public OnPlayerUpdate(playerid)
{
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    if(Health < 1) return SpawnPlayer(playerid);
    return 1;
}
Try that

EDIT: I thought it was a death bug sorry!
This is just the same x), After i die i spawn ..

Quote:
Originally Posted by langricr
View Post
Try changing

Code:
SetPlayerHealth(playerid,99999);
to

Code:
SetPlayerHealth(playerid,64000);
Although I'm pretty sure its not the case, the integer you specify might be overflowing and changing into a negative number because its too high. However, since you claim its not any of the filterscripts and its the only part of the spawn code that changes the player's health, I suggest you try changing it.

Wiki: Integer Overflow
Ok going to try ..


Re: After 2 weeks, server back online, when i spawn i die ! - langricr - 25.06.2011

Quote:
Originally Posted by Michael@Belgium
View Post
Under OnPlayerUpdate there is actually nothing just this:
pawn Code:
public OnPlayerUpdate(playerid)
{
    Streamer_Update(playerid);
    return 1;
}


This is just the same x), After i die i spawn ..



Ok going to try ..
If it doesn't work, try commenting out that line and see if that resolves the issue. If it does, just try a lower number still, perhaps 32000.


Re: After 2 weeks, server back online, when i spawn i die ! - Michael@Belgium - 25.06.2011

Quote:
Originally Posted by langricr
View Post
If it doesn't work, try commenting out that line and see if that resolves the issue. If it does, just try a lower number still, perhaps 32000.
Nope don't work, i commented that line (SetPlayerHealth()) and edited to a lower health (500) But still i die :-/


Re: After 2 weeks, server back online, when i spawn i die ! - langricr - 25.06.2011

Quote:
Originally Posted by Michael@Belgium
View Post
Nope don't work, i commented that line (SetPlayerHealth()) and edited to a lower health (500) But still i die :-/
Then the issue is not there, try running a search for SetPlayerHealth in your script.


Re: After 2 weeks, server back online, when i spawn i die ! - Michael@Belgium - 25.06.2011

Quote:
Originally Posted by langricr
View Post
Then the issue is not there, try running a search for SetPlayerHealth in your script.
Hmm, i have SetPlayerHealth(playerid, 0); at a cmd ( /kill ) and some others ( /afk /brb /back)
Idk it's that ..


Re: After 2 weeks, server back online, when i spawn i die ! - Max_Coldheart - 25.06.2011

show me your /afk, /brb, /back, and OnPlayerConnect & OnPlayerSpawn


Re: After 2 weeks, server back online, when i spawn i die ! - Michael@Belgium - 25.06.2011

Quote:
Originally Posted by Max_Coldheart
View Post
show me your /afk, /brb, /back, and OnPlayerConnect & OnPlayerSpawn
pawn Code:
CMD:afk(playerid, params[])
    {
        new reason[256];
        GetPlayerName(playerid, pName,MAX_PLAYER_NAME);
        if(!sscanf(params,"s[256]",reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /afk [reason]");
        format(string, sizeof(string), "%s is now AFK (Away From Keyboard) [ %s ]", pName,reason);
        SendClientMessageToAll(COLOR_YELLOW, string);
        TogglePlayerControllable(playerid, 0);
        SetPlayerHealth(playerid, 99999999.99);
        return 1;
    }

    CMD:back(playerid, params[])
    {
        GetPlayerName(playerid, pName,MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s is back in game !", pName);
        SendClientMessageToAll(COLOR_YELLOW, string);
        TogglePlayerControllable(playerid, 1);
        SetPlayerHealth(playerid, 100);
        return 1;
    }

    CMD:brb(playerid, params[])
    {
        new reason[256];
        GetPlayerName(playerid, pName,MAX_PLAYER_NAME);
        if(sscanf(params,"%s[256]",reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /brb [reason]");
        format(string, sizeof(string), "%s is gonna be right back ! [ %s ]", pName, reason);
        SendClientMessageToAll(COLOR_YELLOW, string);
        TogglePlayerControllable(playerid, 0);
        SetPlayerHealth(playerid, 99999999.99);
        return 1;
    }
Onplayerconnect & onplayerspawn
pawn Code:
public OnPlayerConnect(playerid)
{
    S_OnPlayerConnect(playerid);
    SetPVarInt(playerid, "ConnectTime", GetTickCount());
    TextDrawShowForPlayer(playerid, Textdraw0);
    GetPlayerName(playerid,pName,32);
    format(string,sizeof string,"%s joined the server. [Ping: %i]",pName,GetPlayerPing(playerid));
    SendClientMessageToAll(COLOR_BROWN,string);
    SendDeathMessage(playerid, playerid, 200);
    gActivePlayers[playerid]++;
/*-*/if(IsPlayerNPC(playerid)) { return 1; }
    SetTimerEx("Record", 5000, false, "d", playerid);
    SendClientMessage(playerid, COLOR_WHITE, "-----------------------------------WELCOME---------------------------------------------------------------------------");
    SendClientMessage(playerid, COLOR_YELLOW, "Welcome to PAT (Police and Terrorist) server!");
    SendClientMessage(playerid, COLOR_PURPLE, "READ IMORTANT SUBJECTS: /rules ** /cmds ** /info ** /pc");
    SendClientMessage(playerid, COLOR_PURPLE, "Rcon admin: Michael@Belgium");
    SendClientMessage(playerid, COLOR_WHITE, "---------------------------------------------------------------------------------------------------------------------");


    GameTextForPlayer(playerid, " ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ Welcome to [MV] ~b~ Police~w~vs~r~ Terrorists !", 3000,6);

    SetPlayerMapIcon(playerid, 1, -2624.0776,607.4563,14.4531, 22, 0,MAPICON_LOCAL);//map icon medic (hospital)
    SetPlayerMapIcon(playerid, 2, -1615.5294,684.0948,7.1875, 30, 0, MAPICON_LOCAL);//map icon cop
    SetPlayerMapIcon(playerid, 3, -2708.4341,376.0833,4.9697, 19, 0, MAPICON_LOCAL);//map icon terro
    SetPlayerMapIcon(playerid, 4, -2623.4309,1404.5974,7.1016, 19, 0, MAPICON_LOCAL);//map icon mafia
    SetPlayerMapIcon(playerid, 5, -1328.6627,437.6554,7.1809, 30, 0, MAPICON_LOCAL);
    SetPlayerMapIcon(playerid, 6, -2037.3209,84.7853,45.3577, 20, 0, MAPICON_LOCAL);//map icon firemen
    SetPlayerMapIcon(playerid, 7, -2554.6504,192.0514,6.1075, 48, 0, MAPICON_LOCAL);//Disco
    SetPlayerMapIcon(playerid, 8, -2269.4568,-155.9554,35.3203,37,0,MAPICON_LOCAL);//duel
    return 1;
}

public OnPlayerSpawn(playerid)
{
    //S_OnPlayerSpawn(playerid);
    new skin = GetPlayerSkin(playerid);
    if(skin == 83 || skin == 165)
    {
        if (IsPlayerAdmin(playerid))
        {
            GivePlayerWeapon(playerid, 9,1);
            GivePlayerWeapon(playerid, 18, 500);
            GivePlayerWeapon(playerid, 26, 500);
            GivePlayerWeapon(playerid, 31, 500);
            GivePlayerWeapon(playerid, 32, 500);
            GivePlayerWeapon(playerid, 36, 500);
            GivePlayerWeapon(playerid, 37, 10000);
            GivePlayerWeapon(playerid, 38, 10000);
            SetPlayerColor(playerid, COLOR_ORANGE);
        }
        else
        {
            new pNAME[MAX_PLAYERS];
            SendClientMessage(playerid, COLOR_RED,"***ONLY ADMINS MAY USE THIS SKIN, PLEASE CHOOSE AGAIN !***");
            GameTextForPlayer(playerid,"~r~KICKED !",2500,0);
            GetPlayerName(playerid,pNAME,32);
            format(string,sizeof(string),"%s tried to get the rcon admin skin but he's BEEN KICKED !",pNAME);
            SendClientMessageToAll(COLOR_RED,string);
            Kick(playerid);
        }
    }

    switch(gTeam[playerid])
    {
        case MEDIC:
        {
            SendClientMessage(playerid, COLOR_YELLOW, ">> You are a medic ! Heal other players before they die ! <<");
            SendClientMessage(playerid, COLOR_YELLOW, ">> Read /duty and /mediccmds !");
            SetPlayerColor(playerid, COLOR_YELLOW);
        }
       
        case FIREMEN:
        {
            SendClientMessage(playerid, COLOR_PINK,">> You are a fireman ! REMEMBER: THIS CLASS IS UNDER CONSTRUCTION !! << ");
            SendClientMessage(playerid, COLOR_PINK,">> Read /duty and /firemencmds !");
            SetPlayerColor(playerid, COLOR_PINK);
        }
       
        case POLICE:
        {
            SendClientMessage(playerid, COLOR_BLUE, ">> You are a cop ! Kill the terrorists/mafia and win points/money ! <<");
            SendClientMessage(playerid, COLOR_BLUE, ">> Read /duty and /policecmds. <<");
            SetPlayerColor(playerid, COLOR_BLUE);
        }
       
        case TERRORIST:
        {
            SendClientMessage(playerid, COLOR_RED, ">> You are a terrorist ! Kill the cops/army and win points/money ! <<");
            SendClientMessage(playerid, COLOR_RED, ">> Read /duty and /terrocmds ! <<");
            SetPlayerColor(playerid, COLOR_RED);
        }
       
        case MAFIA:
        {
            SendClientMessage(playerid,COLOR_GREEN,">> You are the mafia ! Kill the cops / army and win points/money ! <<");
            SendClientMessage(playerid, COLOR_GREEN,">> Read /duty ! << ");
            SetPlayerColor(playerid, COLOR_GREEN);
        }
       
        case ARMY:
        {
            SendClientMessage(playerid, COLOR_WHITE,">> You are the army ! Kill the terrorists/mafia and win points/money ! <<");
            SendClientMessage(playerid, COLOR_WHITE,">> Read /duty and /armycmds ! <<");
            SetPlayerColor(playerid, COLOR_WHITE);
        }
    }

//--------------------------------
    SetPlayerHealth(playerid,99999);
    format(str, sizeof(str), "You can't be killed for %d second(s) (spawn protection)", PROTECTIONTIME);
    SendClientMessage(playerid, 0xFF0000AA, str);
    label[playerid] = Create3DTextLabel("Anti-Spawnkill protected player",0xFF0000AA,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
    SetTimerEx("AntiSpawnkill",PROTECTIONTIME*1000,0,"d",playerid);
//--------------------------------
    return 1;
}



Re: After 2 weeks, server back online, when i spawn i die ! - Michael@Belgium - 25.06.2011

help me further