SA-MP Forums Archive
I Need Help In Variable - 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: I Need Help In Variable (/showthread.php?tid=601311)



I Need Help In Variable - Ramin - 19.02.2016

Hi There In My Code Im Added One Variable See This

PHP код:
new My_Interior;
CMD:derby(playeridparams[])
{
    if (
My_Interior == 15)
    {
        
SendClientMessage(playerid,COLOR_BLUE,"Shoma Hamaknoon Dakhele Derby Hasti");
    }
    else
    {
        
My_Interior 15;
        
SendClientMessage(playerid,COLOR_RED,"Baraye Khoroj Az Derby Bezanid /leavederby");
        
GameTextForPlayer(playerid,"~y~Khoshoomadi Be ~n~~b~Derby Deathmatch"20003);
        
SetPlayerPos(playerid, -1355.9592933.06291036.3334);
        
SetPlayerInterior(playerid15);
        
SetPlayerVirtualWorld(playerid15);
        
SetPlayerHealth(playerid100);
    }
    return 
1;

My Problem Is Variable My_Interior Not Change For Playerid That,s Change For All Server That Means If Player Use /derby My_Interior Changed For All The Server

I Dont Know How To Write it For Playerid


Re: I Need Help In Variable - Karolukas123 - 19.02.2016

Код:
new My_Interior[MAX_PLAYERS];

if (My_Interior[playerid] == 15) 
    { 
        SendClientMessage(playerid,COLOR_BLUE,"Shoma Hamaknoon Dakhele Derby Hasti"); 
    } 
    else 
    { 
        My_Interior[playerid] = 15; 

        SendClientMessage(playerid,COLOR_RED,"Baraye Khoroj Az Derby Bezanid /leavederby"); 
        GameTextForPlayer(playerid,"~y~Khoshoomadi Be ~n~~b~Derby Deathmatch", 2000, 3); 


        SetPlayerPos(playerid, -1355.9592, 933.0629, 1036.3334); 
        SetPlayerInterior(playerid, 15); 
        SetPlayerVirtualWorld(playerid, 15); 

        SetPlayerHealth(playerid, 100); 
    } 
    return 1;



Re: I Need Help In Variable - Ramin - 19.02.2016

Very Thanks <3