SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/09/2018, 03:10 PM   #1
Varg
Little Clucker
 
Join Date: Jun 2018
Posts: 20
Reputation: 0
Default ID 0 Bug

How can i fix ID 0 bug? ID 0 is teleporting when a user kicked/exit. I fixed with add NPC but i dont want to it.

GM: South Central RP

Last edited by Varg; 16/09/2018 at 09:09 PM.
Varg is offline   Reply With Quote
Old 16/09/2018, 03:19 PM   #2
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,309
Reputation: 3191
Default Re: ID 0 Bug

That generally just means you aren't setting the ID correctly.
Y_Less is online now   Reply With Quote
Old 16/09/2018, 07:11 PM   #3
NoorMustafa123
Little Clucker
 
NoorMustafa123's Avatar
 
Join Date: May 2017
Location: idk
Posts: 32
Reputation: 6
Default Re: ID 0 Bug

Quote:
Originally Posted by Varg View Post
How can i fix ID 0 bug? ID 0 is teleporting when a user login/exit or a admin using a teleport command etc... I fixed with add NPC but i dont want to it.

GM: South Central RP
well as Y_Less said, anyway, does it give any error in server_log or mysql_log? if not its from ur script.
__________________
My Works
[Maps] Area 51 | Desert Airport | A Small Island |
NoorMustafa123 is offline   Reply With Quote
Old 16/09/2018, 07:48 PM   #4
willbedie
Gangsta
 
willbedie's Avatar
 
Join Date: Feb 2016
Location: Albania
Posts: 545
Reputation: 59
Default Re: ID 0 Bug

Quote:
Originally Posted by NoorMustafa123 View Post
well as Y_Less said, anyway, does it give any error in server_log or mysql_log? if not its from ur script.
I don't think it gives any error telling you that, it's just a mistake on the script
__________________


willbedie is offline   Reply With Quote
Old 16/09/2018, 07:54 PM   #5
Florin48
Huge Clucker
 
Join Date: Nov 2015
Location: Romania
Posts: 229
Reputation: 4
Default Re: ID 0 Bug

"ID 0 is teleporting when a user login/exit or a admin using a teleport command."
post a command, let's see what's wrong with that command to figure out how we can fix the rest of the bugs.
__________________
=============================================
=============================================
=============================================
Quote:
If I helped you for a while, do not forget to reward me with a good reputation.
=============================================
=============================================
=============================================
Florin48 is offline   Reply With Quote
Old 16/09/2018, 08:01 PM   #6
Varg
Little Clucker
 
Join Date: Jun 2018
Posts: 20
Reputation: 0
Default Re: ID 0 Bug

Server logs and MySQL logs clear.

I'll @Florin48
Varg is offline   Reply With Quote
Old 16/09/2018, 08:06 PM   #7
NoorMustafa123
Little Clucker
 
NoorMustafa123's Avatar
 
Join Date: May 2017
Location: idk
Posts: 32
Reputation: 6
Default Re: ID 0 Bug

send us the codes of OnPlayerConnect and disconnect one and also teleport cmd
__________________
My Works
[Maps] Area 51 | Desert Airport | A Small Island |
NoorMustafa123 is offline   Reply With Quote
Old 16/09/2018, 08:12 PM   #8
Varg
Little Clucker
 
Join Date: Jun 2018
Posts: 20
Reputation: 0
Default Re: ID 0 Bug

PHP Code:
public OnPlayerConnect(playerid)
{
    if (
IsPlayerNPC(playerid))
        return 
1;

    if ((
GetTickCount() - PlayerData[playerid][pLeaveTime]) < 2000 && !strcmp(ReturnIP(playerid), PlayerData[playerid][pLeaveIP]))
    {
        
SendAdminAlert(COLOR_LIGHTRED"[ADMIN]: %s (%s) was kicked for possible rejoin hacks."ReturnName(playerid), ReturnIP(playerid));
        
Kick(playerid);
        return 
1;
    }
    new
        
str[128];

    
ResetPlayerWeapons(playerid);
    
SetPlayerArmedWeapon(playerid0);

    
PreloadAnimations(playerid);

    if (
g_ServerRestart) {
        
TextDrawShowForPlayer(playeridgServerTextdraws[3]);
    }
    for (new 
0!= MAX_PLAYER_ATTACHED_OBJECTS++) {
        
RemovePlayerAttachedObject(playeridi);
    }
    
// Gas pumps
    
RemoveBuildingForPlayer(playerid16761941.6563, -1767.289114.14066000.00);
    
RemoveBuildingForPlayer(playerid34652120.8203914.718811.25786000.00);
    
RemoveBuildingForPlayer(playerid1686, -1610.6172, -2721.000047.92976000.00);

    
// LS mall
    
RemoveBuildingForPlayer(playerid61301117.5859, -1490.007832.718810.0);
    
RemoveBuildingForPlayer(playerid62551117.5859, -1490.007832.718810.0);
    
RemoveBuildingForPlayer(playerid7621175.3594, -1420.187519.88280.25);
    
RemoveBuildingForPlayer(playerid6151166.3516, -1417.695313.95310.25);

    
// Sprunk machines
     
RemoveBuildingForPlayer(playerid13020.00.00.06000.0);
    
RemoveBuildingForPlayer(playerid12090.00.00.06000.0);
    
RemoveBuildingForPlayer(playerid9550.00.00.06000.0);
    
RemoveBuildingForPlayer(playerid9560.00.00.06000.0);
    
RemoveBuildingForPlayer(playerid17750.00.00.06000.0);
    
RemoveBuildingForPlayer(playerid17760.00.00.06000.0);
    
RemoveBuildingForPlayer(playerid19770.00.00.06000.0);

    
// Fire station
    
RemoveBuildingForPlayer(playerid7171703.9922, -1150.148423.09380.25);
    
RemoveBuildingForPlayer(playerid7171721.2344, -1150.148423.09380.25);
    
RemoveBuildingForPlayer(playerid13001715.4922, -1037.976623.26560.25);
    
RemoveBuildingForPlayer(playerid12941734.9531, -1156.992227.35160.25);
    
RemoveBuildingForPlayer(playerid7171738.7813, -1150.148423.09380.25);
    
RemoveBuildingForPlayer(playerid12271789.7734, -1116.062523.89060.25);
    
RemoveBuildingForPlayer(playerid12271789.9063, -1112.640623.89060.25);
    
RemoveBuildingForPlayer(playerid7171726.0000, -1064.882823.15630.25);
    
RemoveBuildingForPlayer(playerid46401728.7891, -1065.093824.50000.25);
    
RemoveBuildingForPlayer(playerid13001730.6328, -1033.671923.26560.25);
    
RemoveBuildingForPlayer(playerid45981737.2031, -1052.820323.33590.25);
    
RemoveBuildingForPlayer(playerid45991738.1875, -1044.992222.98440.25);
    
RemoveBuildingForPlayer(playerid13001747.8594, -1063.296923.26560.25);
    
RemoveBuildingForPlayer(playerid7171758.3828, -1066.359423.17970.25);
    
RemoveBuildingForPlayer(playerid13001758.0781, -1064.554723.26560.25);
    
RemoveBuildingForPlayer(playerid7171765.1563, -1042.523423.17970.25);
    
RemoveBuildingForPlayer(playerid13001764.8594, -1040.718823.26560.25);
    
RemoveBuildingForPlayer(playerid46411788.5391, -1026.351624.50000.25);

    
// Prison exterior
    
RemoveBuildingForPlayer(playerid3682247.92971461.859433.41410.25);
    
RemoveBuildingForPlayer(playerid3682192.27341456.125033.41410.25);
    
RemoveBuildingForPlayer(playerid3682199.75781397.882833.41410.25);
    
RemoveBuildingForPlayer(playerid3683133.74221356.992217.09380.25);
    
RemoveBuildingForPlayer(playerid3683166.78911356.992217.09380.25);
    
RemoveBuildingForPlayer(playerid3683166.78911392.156317.09380.25);
    
RemoveBuildingForPlayer(playerid3683133.74221392.156317.09380.25);
    
RemoveBuildingForPlayer(playerid3683166.78911426.914117.09380.25);
    
RemoveBuildingForPlayer(playerid3683133.74221426.914117.09380.25);
    
RemoveBuildingForPlayer(playerid3288221.57031374.96889.58590.25);
    
RemoveBuildingForPlayer(playerid3289212.07811426.03139.58590.25);
    
RemoveBuildingForPlayer(playerid3290218.25781467.53919.58590.25);
    
RemoveBuildingForPlayer(playerid3291246.56251435.19539.68750.25);
    
RemoveBuildingForPlayer(playerid3291246.56251410.53919.68750.25);
    
RemoveBuildingForPlayer(playerid3291246.56251385.89069.68750.25);
    
RemoveBuildingForPlayer(playerid3291246.56251361.24229.68750.25);
    
RemoveBuildingForPlayer(playerid3290190.91411371.77349.58590.25);
    
RemoveBuildingForPlayer(playerid3289183.74221444.86729.58590.25);
    
RemoveBuildingForPlayer(playerid3289222.50781444.69539.58590.25);
    
RemoveBuildingForPlayer(playerid3289221.17971390.29699.58590.25);
    
RemoveBuildingForPlayer(playerid3288223.17971421.18759.58590.25);
    
RemoveBuildingForPlayer(playerid3683133.74221459.640617.09380.25);
    
RemoveBuildingForPlayer(playerid3289207.53911371.24229.58590.25);
    
RemoveBuildingForPlayer(playerid3424220.64841355.18759.58590.25);
    
RemoveBuildingForPlayer(playerid3424221.70311404.50789.58590.25);
    
RemoveBuildingForPlayer(playerid3424210.41411444.84389.58590.25);
    
RemoveBuildingForPlayer(playerid3424262.50781465.20319.58590.25);
    
RemoveBuildingForPlayer(playerid3259220.64841355.18759.58590.25);
    
RemoveBuildingForPlayer(playerid3636133.74221356.992217.09380.25);
    
RemoveBuildingForPlayer(playerid3636166.78911356.992217.09380.25);
    
RemoveBuildingForPlayer(playerid3256190.91411371.77349.58590.25);
    
RemoveBuildingForPlayer(playerid3636166.78911392.156317.09380.25);
    
RemoveBuildingForPlayer(playerid3636133.74221392.156317.09380.25);
    
RemoveBuildingForPlayer(playerid3258207.53911371.24229.58590.25);
    
RemoveBuildingForPlayer(playerid3675205.64841394.132810.11720.25);
    
RemoveBuildingForPlayer(playerid3675205.64841392.156316.29690.25);
    
RemoveBuildingForPlayer(playerid3675205.64841394.132823.78130.25);
    
RemoveBuildingForPlayer(playerid3675207.35941390.570319.14840.25);
    
RemoveBuildingForPlayer(playerid3675206.50781387.851627.49220.25);
    
RemoveBuildingForPlayer(playerid3673199.75781397.882833.41410.25);
    
RemoveBuildingForPlayer(playerid3257221.57031374.96889.58590.25);
    
RemoveBuildingForPlayer(playerid3258221.17971390.29699.58590.25);
    
RemoveBuildingForPlayer(playerid3675203.95311409.914116.29690.25);
    
RemoveBuildingForPlayer(playerid3674199.38281407.117235.89840.25);
    
RemoveBuildingForPlayer(playerid3675204.64061409.851611.40630.25);
    
RemoveBuildingForPlayer(playerid3675206.50781404.234418.29690.25);
    
RemoveBuildingForPlayer(playerid3675206.50781400.656322.46880.25);
    
RemoveBuildingForPlayer(playerid3259221.70311404.50789.58590.25);
    
RemoveBuildingForPlayer(playerid3675207.35941409.000019.75780.25);
    
RemoveBuildingForPlayer(playerid3257223.17971421.18759.58590.25);
    
RemoveBuildingForPlayer(playerid3258212.07811426.03139.58590.25);
    
RemoveBuildingForPlayer(playerid3636166.78911426.914117.09380.25);
    
RemoveBuildingForPlayer(playerid3636133.74221426.914117.09380.25);
    
RemoveBuildingForPlayer(playerid3255246.56251361.24229.68750.25);
    
RemoveBuildingForPlayer(playerid3255246.56251385.89069.68750.25);
    
RemoveBuildingForPlayer(playerid3255246.56251410.53919.68750.25);
    
RemoveBuildingForPlayer(playerid3258183.74221444.86729.58590.25);
    
RemoveBuildingForPlayer(playerid3259210.41411444.84389.58590.25);
    
RemoveBuildingForPlayer(playerid3258222.50781444.69539.58590.25);
    
RemoveBuildingForPlayer(playerid16086232.28911434.484413.50000.25);
    
RemoveBuildingForPlayer(playerid3673192.27341456.125033.41410.25);
    
RemoveBuildingForPlayer(playerid3674183.03911455.750035.89840.25);
    
RemoveBuildingForPlayer(playerid3636133.74221459.640617.09380.25);
    
RemoveBuildingForPlayer(playerid3675196.02341462.015610.11720.25);
    
RemoveBuildingForPlayer(playerid3675198.00001462.015616.29690.25);
    
RemoveBuildingForPlayer(playerid3675196.02341462.015623.78130.25);
    
RemoveBuildingForPlayer(playerid3675180.24221460.320316.29690.25);
    
RemoveBuildingForPlayer(playerid3675180.30471461.007811.40630.25);
    
RemoveBuildingForPlayer(playerid3256218.25781467.53919.58590.25);
    
RemoveBuildingForPlayer(playerid3675199.58591463.726619.14840.25);
    
RemoveBuildingForPlayer(playerid3675181.15631463.726619.75780.25);
    
RemoveBuildingForPlayer(playerid3675185.92191462.875018.29690.25);
    
RemoveBuildingForPlayer(playerid3675202.30471462.875027.49220.25);
    
RemoveBuildingForPlayer(playerid3675189.50001462.875022.46880.25);
    
RemoveBuildingForPlayer(playerid3255246.56251435.19539.68750.25);
    
RemoveBuildingForPlayer(playerid3675254.67971451.828127.49220.25);
    
RemoveBuildingForPlayer(playerid3675253.82031458.109423.78130.25);
    
RemoveBuildingForPlayer(playerid3675255.53131454.546919.14840.25);
    
RemoveBuildingForPlayer(playerid3675253.82031456.132816.29690.25);
    
RemoveBuildingForPlayer(playerid3675253.82031458.109410.11720.25);
    
RemoveBuildingForPlayer(playerid3259262.50781465.20319.58590.25);
    
RemoveBuildingForPlayer(playerid3675254.67971468.210918.29690.25);
    
RemoveBuildingForPlayer(playerid3673247.92971461.859433.41410.25);
    
RemoveBuildingForPlayer(playerid3675254.67971464.632822.46880.25);
    
RemoveBuildingForPlayer(playerid3674247.55471471.093835.89840.25);
    
RemoveBuildingForPlayer(playerid3675255.53131472.976619.75780.25);
    
RemoveBuildingForPlayer(playerid3675252.81251473.828111.40630.25);
    
RemoveBuildingForPlayer(playerid3675252.12501473.890616.29690.25);
    
RemoveBuildingForPlayer(playerid16089342.12501431.09385.27340.25);
    
RemoveBuildingForPlayer(playerid16090315.77341431.09385.27340.25);
    
RemoveBuildingForPlayer(playerid16091289.74221431.09385.27340.25);
    
RemoveBuildingForPlayer(playerid16087358.67971430.453111.61720.25);
    
RemoveBuildingForPlayer(playerid16088368.42971431.09385.27340.25);
    
RemoveBuildingForPlayer(playerid16092394.15631431.09385.27340.25);

    
CancelSelectTextDraw(playerid);

    
GetPlayerIp(playeridPlayerData[playerid][pIP], 16);
    
GetPlayerName(playeridPlayerData[playerid][pUsername], MAX_PLAYER_NAME 1);

    
ResetStatistics(playerid);
    
CreateTextDraws(playerid);

    
format(strsizeof(str), "SELECT * FROM `blacklist` WHERE `Username` = '%s' OR `IP` = '%s'"ReturnName(playerid), PlayerData[playerid][pIP]);
    
mysql_tquery(g_iHandlestr"OnQueryFinished""dd"playeridTHREAD_BAN_LOOKUP);
    return 
1;

PHP Code:
public OnPlayerDisconnect(playeridreason)
{
    
PlayerData[playerid][pLeaveTime] = GetTickCount();

    
format(PlayerData[playerid][pLeaveIP], 16PlayerData[playerid][pIP]);

     
TerminateConnection(playerid);
    return 
1;

PHP Code:
stock TerminateConnection(playerid)
{
    if (
BoomboxData[playerid][boomboxPlaced])
        
Boombox_Destroy(playerid);

    if (
PlayerData[playerid][pRangeBooth] != -1)
        
Booth_Leave(playerid);

    if (
PlayerData[playerid][pFirstAid])
        
KillTimer(PlayerData[playerid][pAidTimer]);

    if (
PlayerData[playerid][pDrivingTest])
        
DestroyVehicle(PlayerData[playerid][pTestCar]);

    if (
PlayerData[playerid][pShowFooter])
        
KillTimer(PlayerData[playerid][pFooterTimer]);

    if (
PlayerData[playerid][pTaxiPlayer] != INVALID_PLAYER_ID)
        
LeaveTaxi(playeridPlayerData[playerid][pTaxiPlayer]);

    if (
PlayerData[playerid][pDragged])
        
KillTimer(PlayerData[playerid][pDragTimer]);

    if (
PlayerData[playerid][pFreeze])
        
KillTimer(PlayerData[playerid][pFreezeTimer]);

    foreach (new 
Player)
    {
        if (
PlayerData[i][pLastShot] == playerid) {
            
PlayerData[i][pLastShot] = INVALID_PLAYER_ID;
        }
        if (
PlayerData[i][pHouseSeller] == playerid) {
            
PlayerData[i][pHouseSeller] = INVALID_PLAYER_ID;
            
PlayerData[i][pHouseOffered] = -1;
        }
        if (
PlayerData[i][pBusinessSeller] == playerid) {
            
PlayerData[i][pBusinessSeller] = INVALID_PLAYER_ID;
            
PlayerData[i][pBusinessOffered] = -1;
        }
        if (
PlayerData[i][pCarSeller] == playerid) {
            
PlayerData[i][pCarSeller] = INVALID_PLAYER_ID;
            
PlayerData[i][pCarOffered] = -1;
        }
        if (
PlayerData[i][pShakeOffer] == playerid) {
            
PlayerData[i][pShakeOffer] = INVALID_PLAYER_ID;
            
PlayerData[i][pShakeType] = 0;
        }
        if (
PlayerData[i][pFriskOffer] == playerid) {
            
PlayerData[i][pFriskOffer] = INVALID_PLAYER_ID;
        }
        if (
PlayerData[i][pFoodSeller] == playerid) {
            
PlayerData[i][pFoodSeller] = INVALID_PLAYER_ID;
            
PlayerData[i][pFoodType] = 0;
        }
        if (
PlayerData[i][pFactionOffer] == playerid) {
            
PlayerData[i][pFactionOffer] = INVALID_PLAYER_ID;
            
PlayerData[i][pFactionOffered] = -1;
        }
        if (
PlayerData[i][pDraggedBy] == playerid) {
            
KillTimer(PlayerData[i][pDragTimer]);

            
PlayerData[i][pDragged] = 0;
            
PlayerData[i][pDraggedBy] = INVALID_PLAYER_ID;
        }
        if (
PlayerData[i][pMDCPlayer] == playerid) {
            
PlayerData[i][pMDCPlayer] = INVALID_PLAYER_ID;
            
PlayerData[i][pTrackTime] = 0;
        }
        if (
PlayerData[i][pNewsGuest] == playerid) {
            
PlayerData[i][pNewsGuest] = INVALID_PLAYER_ID;
        }
        if (
PlayerData[i][pGiveItem] == playerid) {
            
PlayerData[i][pGiveItem] = INVALID_PLAYER_ID;
        }
        if (
PlayerData[i][pTakeItems] == playerid) {
            
PlayerData[i][pTakeItems] = INVALID_PLAYER_ID;
        }
    }
    
SQL_SaveCharacter(playerid);
    
ResetNameTag(playerid);
    
Report_Clear(playerid);
    
ResetStatistics(playerid);
    return 
1;


Last edited by Varg; 16/09/2018 at 09:17 PM.
Varg is offline   Reply With Quote
Old 16/09/2018, 08:13 PM   #9
NoorMustafa123
Little Clucker
 
NoorMustafa123's Avatar
 
Join Date: May 2017
Location: idk
Posts: 32
Reputation: 6
Default Re: ID 0 Bug

Quote:
Originally Posted by willbedie View Post
I don't think it gives any error telling you that, it's just a mistake on the script
there is a chance to be something in mysql, something like error #1044 or anything
__________________
My Works
[Maps] Area 51 | Desert Airport | A Small Island |
NoorMustafa123 is offline   Reply With Quote
Old 16/09/2018, 09:12 PM   #10
Varg
Little Clucker
 
Join Date: Jun 2018
Posts: 20
Reputation: 0
Default Re: ID 0 Bug

When im join ID 0

mysql_log: [WARNING] CMySQLHandle::Create - connection already exists

Commands working no problem. Now just ID 0 teleporting when a player disconnect.
Varg is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 11:43 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.