Warning 211 & 204 with OnPlayerSpawn !!
#1

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
Reply
#2

Could you show me the errors? :\
Reply
#3

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)

Reply
#4

if(skinidi = 0) should be if(skinidi == 0)
Reply
#5

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
Reply
#6

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.
Reply
#7

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

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

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
Reply
#10

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
Reply
#11

TY but it random the spawn for every skin
not one spawn for one skin
Reply
#12

[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.");
   }
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)