SA-MP Forums Archive
Help with player spawn - 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: Help with player spawn (/showthread.php?tid=306283)



Help with player spawn - mhamadsaleh - 26.12.2011

warning 211: possibly unintended assignment

line 4169 if(IsInDM[playerid] ==0)



please help i dont see what the problem is



PHP код:
if(DMZone[playerid] >= 1)
    {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        
if(DMZone[playerid] == 1)
        {
            new 
RandomSpawn random(6);
            if (
RandomSpawn == 0)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid2595.3945,2758.7642,23.8222);
                
SetPlayerFacingAngle(playerid247.9706);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 1)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid2600.9648,2726.4263,23.8222);
                
SetPlayerFacingAngle(playerid329.4380);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 2)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid2639.5300,2729.5732,23.8222);
                
SetPlayerFacingAngle(playerid46.8321);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 3)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid2642.3181,2757.0920,23.8222);
                
SetPlayerFacingAngle(playerid121.7195);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 4)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid2649.0498,2780.8462,19.3222);
                
SetPlayerFacingAngle(playerid196.2701);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 5)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid2607.4639,2732.1467,36.5386);
                
SetPlayerFacingAngle(playerid255.2007);
                
SetCameraBehindPlayer(playerid);
            }
            
GivePlayerWeapon(playerid382000);
            
SetPlayerInterior(playerid0);
            
SendClientMessage(playeridCOLOR_RED"SHOOTING WITH MINIGUN OUTSIDE -MINIGUNMADNESS- WIL RESULT IN KICK OR BAN!!!");
            
SendClientMessage(playeridCOLOR_GREY"Use /ExitDM to exit MinigunMadness.");
        }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        
if(DMZone[playerid] == 2)
        {
            new 
RandomSpawn random(9);
            if (
RandomSpawn == 0)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid, -2473.3635,1552.3779,33.2273);
                
SetPlayerFacingAngle(playerid162.4520);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 1)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid, -2464.5215,1531.9247,17.3281);
                
SetPlayerFacingAngle(playerid356.1172);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 2)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid, -2460.7542,1551.8220,23.1406);
                
SetPlayerFacingAngle(playerid179.0821);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 3)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid, -2444.2595,1530.2435,20.2344);
                
SetPlayerFacingAngle(playerid340.1136);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 4)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid, -2401.1440,1532.8340,26.0469);
                
SetPlayerFacingAngle(playerid17.7140);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 5)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid, -2374.3948,1535.5518,26.0469);
                
SetPlayerFacingAngle(playerid57.7976);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 6)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid, -2359.6692,1561.0190,26.0469);
                
SetPlayerFacingAngle(playerid162.1386);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 7)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid, -2382.4871,1547.8801,10.8281);
                
SetPlayerFacingAngle(playerid108.2448);
                
SetCameraBehindPlayer(playerid);
            }
            if (
RandomSpawn == 8)
            {
                
InCar[playerid] = false;
                
SetPlayerPos(playerid, -2422.0405,1551.3163,7.9219);
                
SetPlayerFacingAngle(playerid143.3385);
                
SetCameraBehindPlayer(playerid);
            }
            
GivePlayerWeapon(playerid41);
            
GivePlayerWeapon(playerid2447);
            
GivePlayerWeapon(playerid2644);
            
SetPlayerInterior(playerid0);
            
SendClientMessage(playeridCOLOR_RED"SHOOTING WITH WEAPONS OUTSIDE -GlassMadness.- WIL RESULT IN KICK OR BAN!!!");
            
SendClientMessage(playeridCOLOR_GREY"Use /ExitDM to exit GlassMadness.");
        }
  else
  if(
DMZone[playerid] = 0)
  {
 if(
IsPlayerLuxAdmin(playerid) || IsPlayerAdmin(playerid))
    {
        
SetPlayerPos(playerid, -2934.1000,-543.9000,4.9000);
        
SetPlayerInterior(playerid0); 
           
GameTextForPlayer(playerid,"~r~/Cmds ~b~/Rules",2500,5);
           
TextDrawShowForPlayer(playeridTextdraw1);
           
TextDrawShowForPlayer(playeridTextdraw0);
    }
    else
    {
        
SetPlayerPos(playerid, -2353.2153,-1641.8929,483.7031);
        
SetPlayerInterior(playerid0); 
           
GameTextForPlayer(playerid,"~r~/Cmds ~b~/Rules",2500,5);
           
TextDrawShowForPlayer(playeridTextdraw1);
           
TextDrawShowForPlayer(playeridTextdraw0);
    }
}
}
    return 
1;




Re: Help with player spawn - BrandyPenguin - 26.12.2011

In code you have
if(DMZone[playerid] = 0) not
if(DMZone[playerid] == 0)
anyway is not easier to use just else?


Re: Help with player spawn - mhamadsaleh - 26.12.2011

Thank you , if i just use else i get 26 errors XD


Re: Help with player spawn - [ABK]Antonio - 26.12.2011

new const Float:RandSpawn[2][4] = {
{X,Y,Z,Angle},
{X,Y,Z,Angle}
};

new rand = random(sizeof(RandSpawn));

SetPlayerPos(playerid, RandSpawn[rand][0], RandSpawn[rand][1], RandSpawn[rand][2]);
SetPlayerFacingAngle(playerid, RandSpawn[rand][3]);