SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 26/06/2013, 05:37 PM   #1
lean1337
Big Clucker
 
Join Date: Nov 2012
Location: Sweden, Malmö
Posts: 168
Reputation: 22
Default Spectate system bug.

Hi, Im having issues with my spectate system, when I spec someone and he goes into an interior most of the time it bugs out and I cant see anything. Like it happends when you spectate an invalid playerid for example. I tryed debugging aswell and here is the results.


Lean_Laptop is spectating Charles_Washington

pawn Code:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)//This is called when a player's interior is changed.
{
if(IsSpecing[playerid] == 1) return 0;
printf("OnPlayerInteriorChange called for player %s",GetName(playerid));
    if(IsBeingSpeced[playerid] == 1)//If the player being spectated, changes an interior, then update the interior and virtualword for the spectator.
    {
        foreach(Player,i)
        {
            if(spectatorid[i] == playerid)
            {
                SetPlayerInterior(i,GetPlayerInterior(playerid));
                printf("Interior set to %d for player %s, should be %d",GetPlayerInterior(i),GetName(i),GetPlayerInterior(playerid));
             //   SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(playerid));
            }
        }
    }
    return 1;
}




[19:33:25] OnPlayerInteriorChange called for player Charles_Washington
[19:33:25] Interior set to 7 for player Charles_Washington, should be 7
[19:33:25] Interior set to 0 for player Lean_Laptop, should be 7
[19:34:11] OnPlayerInteriorChange called for player Charles_Washington
[19:34:11] Interior set to 0 for player Charles_Washington, should be 0
[19:34:11] Interior set to 7 for player Lean_Laptop, should be 0
[19:34:14] OnPlayerInteriorChange called for player Charles_Washington
[19:34:14] Interior set to 7 for player Charles_Washington, should be 7
[19:34:14] Interior set to 0 for player Lean_Laptop, should be 7
lean1337 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Spectate System For Players. RandomDude Filterscripts 7 24/07/2013 02:18 PM
Spectate NeverKnow Scripting Help 12 29/09/2012 10:33 AM
[FilterScript] [FS] Spectate System (Edit from adminspec) Oxside Filterscripts 19 21/10/2011 02:52 PM
[FilterScript] [FS]spectate System [BP]Tony Filterscripts 12 26/06/2011 05:48 PM
[FilterScript] Spectate System Nonameman Filterscripts 11 22/08/2010 03:07 AM


All times are GMT. The time now is 08:56 AM.


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