SA-MP Forums Archive
Warning 211 & 204 with OnPlayerSpawn !! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Warning 211 & 204 with OnPlayerSpawn !! (/showthread.php?tid=152128)



Warning 211 & 204 with OnPlayerSpawn !! - Yaszine - 02.06.2010

Hello all

I have two warning with my GM, its 211 & 204

I have 3 skin for my GM (only test )
pawn Код:
AddPlayerClass(2,403.447265,2466.154296,16.506214,115.0000,0,0,0,1,0,0);//
AddPlayerClass(22,403.447265,2466.154296,16.506214,115.0000,0,0,0,1,0,0);//
AddPlayerClass(23,403.447265,2466.154296,16.506214,115.0000,0,0,0,1,0,0);//
and this
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,0);
    GivePlayerMoney(playerid,1000);

 new skinidi = GetPlayerSkin(playerid);
 if(skinidi = 0)
 {
  switch(random(3))
   {
   case 0 :SetPlayerPos(playerid,1433.0177,1492.2183,10.8422),SendClientMessage(playerid,COLOR_WHITE,"You're in /lva.");
   case 1 :SetPlayerPos(playerid,1838.9441,-1356.9666,13.5625),SendClientMessage(playerid,COLOR_WHITE,"You're in /ls1.");
   case 2 :SetPlayerPos(playerid,1989.5594,1091.2728,10.6719),SendClientMessage(playerid,COLOR_WHITE,"You're in /lv1.");
   }
  }
return 1;
}
Can you show me the problem Coz if i chose a player and pressing Spawn it not spawn he on the place
i want, but one place for ALL not Rand

Thanks a lot


Re: Warning 211 & 204 with OnPlayerSpawn !! - Infinity - 02.06.2010

Could you show me the errors? :\


Re: Warning 211 & 204 with OnPlayerSpawn !! - Yaszine - 02.06.2010

pawn Код:
warning 204: symbol is assigned a value that is never used: "skinidi"
warning 211: possibly unintended assignment
In this line !
pawn Код:
if(skinidi = 0)




Re: Warning 211 & 204 with OnPlayerSpawn !! - Infinity - 02.06.2010

if(skinidi = 0) should be if(skinidi == 0)


Re: Warning 211 & 204 with OnPlayerSpawn !! - Yaszine - 02.06.2010

Quote:
Originally Posted by [jS
Infinity ]
if(skinidi = 0) should be if(skinidi == 0)
Yeah it work TY
but in the server if i chose a person for exampl firft one, normaly it spawn me in /lva
NoOOOOOOOOOO !! not work, spawn every skin you chose to one place



Re: Warning 211 & 204 with OnPlayerSpawn !! - ViruZZzZ_ChiLLL - 02.06.2010

Quote:
Originally Posted by Yaszine
Quote:
Originally Posted by [jS
Infinity ]
if(skinidi = 0) should be if(skinidi == 0)
Yeah it work TY
but in the server if i chose a person for exampl firft one, normaly it spawn me in /lva
NoOOOOOOOOOO !! not work, spawn every skin you chose to one place
well its because you don't have a Skin ID 0 -.-'
you have skins, 2, 22, and 23.


Re: Warning 211 & 204 with OnPlayerSpawn !! - Yaszine - 02.06.2010

How can I do it ?
Can you give me a example for ID 2


Re: Warning 211 & 204 with OnPlayerSpawn !! - ViruZZzZ_ChiLLL - 02.06.2010

it should be :
pawn Код:
if(skinidi == 2)
if(skinidi == 22)
if(skinidi == 23)
because you don't have a Skin ID 0 :P


Re: Warning 211 & 204 with OnPlayerSpawn !! - Yaszine - 02.06.2010

Give me a spawn for this 3 skin : 2 22 23 Plz
or exampl of two

If i do
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,0);
    GivePlayerMoney(playerid,1000);

 new skinidi = GetPlayerSkin(playerid);
 if(skinidi == 2)
 if(skinidi == 22)
 if(skinidi == 23)
 {
  switch(random(3))
    {
   case 0 :SetPlayerPos(playerid,1433.0177,1492.2183,10.8422),SendClientMessage(playerid,COLOR_WHITE,"/lva.");
   case 1 :SetPlayerPos(playerid,1838.9441,-1356.9666,13.5625),SendClientMessage(playerid,COLOR_WHITE,"/ls1.");
   case 2 :SetPlayerPos(playerid,1989.5594,1091.2728,10.6719),SendClientMessage(playerid,COLOR_WHITE,"/lv1.");
    }
 }
return 1;
}
it Compil without errors but in the server it not work
it spawn all them in one place



Re: Warning 211 & 204 with OnPlayerSpawn !! - (SF)Noobanatior - 03.06.2010

pawn Код:
public OnPlayerSpawn(playerid) {
    SetPlayerInterior(playerid,0);
    GivePlayerMoney(playerid,1000);

 new skinidi = GetPlayerSkin(playerid);
 if(skinidi == 2 || skinidi == 22 || skinidi == 23) {
  switch(random(3)) {
   case 0 :SetPlayerPos(playerid,1433.0177,1492.2183,10.8422),SendClientMessage(playerid,COLOR_WHITE,"/lva.");
   case 1 :SetPlayerPos(playerid,1838.9441,-1356.9666,13.5625),SendClientMessage(playerid,COLOR_WHITE,"/ls1.");
   case 2 :SetPlayerPos(playerid,1989.5594,1091.2728,10.6719),SendClientMessage(playerid,COLOR_WHITE,"/lv1.");
    }
 }
return 1;
}
i think this is what you are after


Re: Warning 211 & 204 with OnPlayerSpawn !! - Yaszine - 03.06.2010

TY but it random the spawn for every skin
not one spawn for one skin


Re: Warning 211 & 204 with OnPlayerSpawn !! - Yaszine - 03.06.2010

[SOLVED]#~

pawn Код:
if(skinidi == 2){
   SetPlayerPos(playerid,1433.0177,1492.2183,10.8422),SendClientMessage(playerid,COLOR_WHITE,"Vous кtes dans /lva.");
   }
 if(skinidi == 22){
   SetPlayerPos(playerid,1838.9441,-1356.9666,13.5625),SendClientMessage(playerid,COLOR_WHITE,"Vous кtes dans /ls1.");
   }
 if(skinidi == 23){
   SetPlayerPos(playerid,1989.5594,1091.2728,10.6719),SendClientMessage(playerid,COLOR_WHITE,"Vous кtes dans /lv1.");
   }