SA-MP Forums Archive
When text-draw is clicked not changing to next player - 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: When text-draw is clicked not changing to next player (/showthread.php?tid=652248)



When text-draw is clicked not changing to next player - Jokers98s - 06.04.2018

All the other things are working. expect this

PHP код:
 if(playertextid == _TD_see_player[playerid][3]) // LEFT
        
{
            for(new 
GPVI(playerid"see_playerid"); GPVI(playerid"see_playerid"); i--)
            {
                if(
IsPlayerConnected(i) && GPVI(i"pld_loginned"))
                {
                        
SPVI(playerid"see_playerid"i);
                        
updateSeeTextDraws(playerid1);
                        break;
                }
            }
        }
        else if(
playertextid == _TD_see_player[playerid][4]) // RIGHT
        
{
            for(new 
GPVI(playerid"see_playerid"); GPVI(playerid"see_playerid"); i++)
            {
                if(
IsPlayerConnected(i) && GPVI(i"pld_loginned"))
                {
                        
SPVI(playerid"see_playerid"i);
                        
updateSeeTextDraws(playerid1);
                        break;
                }
            }
        } 



Re: When text-draw is clicked not changing to next player - Mugala - 06.04.2018

if(i == 0) i = MAX_PLAYERS+1; <--- ? what are you trying to do with this?
use PVars or make player's global variable which will detect player's current spectating ID.

for example when player goes in spec, use SetPVarInt(playerid,"Spectating",targetid);
and than you can use PlayerSpectatePlayer(playerid,GetPVarInt(playerid, "Spectating")+1, SetPVarInt(playerid,"Spectating",GetPVarInt(player id,"Spectating")+1);


Re: When text-draw is clicked not changing to next player - Jokers98s - 08.04.2018

How can i reconfig the above code.