SA-MP Forums Archive
CJ on class selection!??!?! [Almost solved, PLEASE check!!] - 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: CJ on class selection!??!?! [Almost solved, PLEASE check!!] (/showthread.php?tid=149237)

Pages: 1 2


CJ on class selection!??!?! [Almost solved, PLEASE check!!] - leapfish - 21.05.2010

Hello all, I have weird problems with player spawns...

Ok here is how it works...

Ok first I have a intro on my server when player connects, after intro finishes player gets to choose a class (class selection), ok now I found some very strange thing, On class selection the first skin I can choose is CJ skin (which I didn't even add as a class!?!?), so when I choose a CJ skin and I click spawn, I spawn and first few mili seconds I can see every car, person, after that I can't see anything, every car disappears, I can't see any person or anything, I have to do /kill and after that it's all normal...

So I tried with F4 and /kill again, to see where is the problem, but I couldn't find....
Every time I go on right side (press right arrow, to go on next class (team)) it works everything good, as soon as I press left arrow (to go on left side, to choose previous class(team)) and I click spawn, I have the same problem of not seeing anything...


Can anyone please help me solve the problem I would really appreciate it, please help me guys, I'm going crazy about this!!!!!



Re: Spawn problems (weird thing, never seen before...) - leapfish - 21.05.2010

Ok thanks it worked!!!!

There is still one little problem...

There is still CJ skin as first on class selection and I didn't even add it
When I choose CJ as a skin, and click SPAWN it drop the character from the SKY, and I'm actually still on a class selection...


Re: Spawn problems (weird thing, never seen before...) - leapfish - 23.05.2010

There is no, I checked everything....

Can anyone PLEASE help me, I still have CJ skin as first in class selection!!!!!!!!
PLEASE HELP ME!

I never added CJ on class selection, I have no idea how did he show up, and when I click on SPAWN it won't spawn....

The rest is fixed, only CJ is left.. Please help me fix it also...

What's the problem so CJ skin shows up instead of aztecas one?


Re: Spawn problems (weird thing, never seen before...) - leapfish - 24.05.2010

Please anyone help, I need to get rid of CJ in class selection...


Re: Spawn problems (weird thing, never seen before...) - Bomber - 24.05.2010

OnPlayerSpawn put this:
SetPlayerPos


Re: Spawn problems (weird thing, never seen before...) - leapfish - 24.05.2010

Quote:
Originally Posted by Bomba || ❶❸❸❼
OnPlayerSpawn put this:
SetPlayerPos
Put what? And how will that delete CJ skin on class selection...

Here is part of a code I use...

Under OnGameModeInit...
pawn Код:
// PlayerClasses
  // Aztecas //
  AddPlayerClassEx(0, 292, 1673.6190, -2122.3142,  14.1460, 296.6250, 0,0, 0,0, 0,0);
  AddPlayerClassEx(0, 115, 1673.6190, -2122.3142,  14.1460, 296.6250, 0,0, 0,0, 0,0);
  AddPlayerClassEx(0, 116, 1673.6190, -2122.3142,  14.1460, 296.6250, 0,0, 0,0, 0,0);
  AddPlayerClassEx(0, 41, 1673.6190, -2122.3142,  14.1460, 296.6250, 0,0, 0,0, 0,0);
  // Vagos //
  AddPlayerClassEx(1, 108, 2626.4180, -1098.8073,  69.3514, 280.0232, 0,0, 0,0, 0,0);
  AddPlayerClassEx(1, 109, 2626.4180, -1098.8073,  69.3514, 280.0232, 0,0, 0,0, 0,0);
  AddPlayerClassEx(1, 110, 2626.4180, -1098.8073,  69.3514, 280.0232, 0,0, 0,0, 0,0);
  AddPlayerClassEx(1, 215, 2626.4180, -1098.8073,  69.3514, 280.0232, 0,0, 0,0, 0,0);
  // Ballas //
  AddPlayerClassEx(2, 102, 2277.6997, -1134.3367, 1050.8984, 264.2271, 0,0, 0,0, 0,0);
  AddPlayerClassEx(2, 103, 2277.6997, -1134.3367, 1050.8984, 264.2271, 0,0, 0,0, 0,0);
  AddPlayerClassEx(2, 104, 2277.6997, -1134.3367, 1050.8984, 264.2271, 0,0, 0,0, 0,0);
  AddPlayerClassEx(2, 13, 2277.6997, -1134.3367, 1050.8984, 264.2271, 0,0, 0,0, 0,0);
  // Grove //
  AddPlayerClassEx(3, 269, 2525.9170, -1674.7805, 1015.4986, 270.4626, 0,0, 0,0, 0,0);
  AddPlayerClassEx(3, 270, 2525.9170, -1674.7805, 1015.4986, 270.4626, 0,0, 0,0, 0,0);
  AddPlayerClassEx(3, 271, 2525.9170, -1674.7805, 1015.4986, 270.4626, 0,0, 0,0, 0,0);
  AddPlayerClassEx(3, 195, 2525.9170, -1674.7805, 1015.4986, 270.4626, 0,0, 0,0, 0,0);
  // Dealers //
  AddPlayerClassEx(4, 28, 2744.3135, -1960.9834,  21.7099, 262.9126, 0,0, 0,0, 0,0);
  AddPlayerClassEx(4, 29, 2744.3135, -1960.9834,  21.7099, 262.9126, 0,0, 0,0, 0,0);
  AddPlayerClassEx(4, 30, 2744.3135, -1960.9834,  21.7099, 262.9126, 0,0, 0,0, 0,0);
  AddPlayerClassEx(4, 12, 2744.3135, -1960.9834,  21.7099, 262.9126, 0,0, 0,0, 0,0);
  // Cops //
  AddPlayerClassEx(5, 265, 218.3181,  69.2598, 1005.0391, 272.1958, 0,0, 0,0, 0,0);
  AddPlayerClassEx(5, 266, 218.3181,  69.2598, 1005.0391, 272.1958, 0,0, 0,0, 0,0);
  AddPlayerClassEx(5, 267, 218.3181,  69.2598, 1005.0391, 272.1958, 0,0, 0,0, 0,0);
  AddPlayerClassEx(5, 246, 218.3181,  69.2598, 1005.0391, 272.1958, 0,0, 0,0, 0,0);
  // Bikers //
  AddPlayerClassEx(6, 100, 865.1848, -1634.4077,  14.9297, 176.2746, 0,0, 0,0, 0,0);
  AddPlayerClassEx(6, 247, 865.1848, -1634.4077,  14.9297, 176.2746, 0,0, 0,0, 0,0);
  AddPlayerClassEx(6, 248, 865.1848, -1634.4077,  14.9297, 176.2746, 0,0, 0,0, 0,0);
  AddPlayerClassEx(6, 201, 865.1848, -1634.4077,  14.9297, 176.2746, 0,0, 0,0, 0,0);
  // Rappers //
  AddPlayerClassEx(7, 293, 1252.9651, -795.6196, 1084.2344, 313.6620, 0,0, 0,0, 0,0);
  AddPlayerClassEx(7, 297, 1252.9651, -795.6196, 1084.2344, 313.6620, 0,0, 0,0, 0,0);
  AddPlayerClassEx(7, 19, 1252.9651, -795.6196, 1084.2344, 313.6620, 0,0, 0,0, 0,0);
  AddPlayerClassEx(7, 233, 1252.9651, -795.6196, 1084.2344, 313.6620, 0,0, 0,0, 0,0);
  // Hoodlums //
  AddPlayerClassEx(8, 183, 2746.2112, -2454.1011,  16.6562, 271.6301, 0,0, 0,0, 0,0);
  AddPlayerClassEx(8, 21, 2746.2112, -2454.1011,  16.6562, 271.6301, 0,0, 0,0, 0,0);
  AddPlayerClassEx(8, 22, 2746.2112, -2454.1011,  16.6562, 271.6301, 0,0, 0,0, 0,0);
  AddPlayerClassEx(8, 190, 2746.2112, -2454.1011,  16.6562, 271.6301, 0,0, 0,0, 0,0);
  // Workers //
  AddPlayerClassEx(9, 27, 1227.4185, -1243.5392,  19.6232, 222.0879, 0,0, 0,0, 0,0);
  AddPlayerClassEx(9, 153, 1227.4185, -1243.5392,  19.6232, 222.0879, 0,0, 0,0, 0,0);
  AddPlayerClassEx(9, 16, 1227.4185, -1243.5392,  19.6232, 222.0879, 0,0, 0,0, 0,0);
  AddPlayerClassEx(9, 192, 1227.4185, -1243.5392,  19.6232, 222.0879, 0,0, 0,0, 0,0);
  // Admins //
  AddPlayerClassEx(10, 217, 1117.7378, -2038.7366, 78.2109, 270.3770, 0,0, 0,0, 0,0);
  AddPlayerClassEx(10, 211, 1117.7378, -2038.7366, 78.2109, 270.3770, 0,0, 0,0, 0,0);
OnPlayerRequestClass

pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
  PlayerInfo[playerid][ pClassID ] = classid;

  if(PlayerInfo[playerid][justConn])
  {
          TogglePlayerSpectating(playerid, 1);
            format(PlayerInfo[playerid][TempIntroString],256," ");
            TextDrawBoxColor(text_fadeblack[playerid], 0x00000000);
          PlayerInfo[playerid][introStringIndex] = 0;
            PlayerInfo[playerid][FirstIntroFlash] = false;
            PlayerInfo[playerid][EndedIntro] = false;
            PlayerInfo[playerid][inIntro] = true;
            PlayerInfo[playerid][introIndex] = 0;
            PlayerInfo[playerid][justConn] = false;
            PlayerInfo[playerid][justClass] = true;
            PlayerInfo[playerid][introOffset] = 0;
            TextDrawShowForPlayer(playerid, text_fadeblack[playerid]);
            TextDrawShowForPlayer(playerid, skip_intro);
            TextDrawBoxColor(text_fadeblack[playerid], 0x00000005);
            TextDrawShowForPlayer(playerid, intro_gmname[playerid]);
            TextDrawSetString(intro_gmname[playerid], " ");
            PlayerPlaySound(playerid, 1142, 0, 0, 0);
            PlayerInfo[playerid][introTimer] = SetTimerEx("Intro", 25, true, "i", playerid);
      return 0;
  }

  if(PlayerInfo[playerid][inIntro]) {
      return 0;
    }
    PlayerInfo[playerid][RequestingClass] = true;

    SetPlayerPos(playerid, player_x,player_y,player_z);
    SetPlayerFacingAngle(playerid, player_angle);
    SetPlayerCameraPos(playerid, camera_x,camera_y,camera_z);
    SetPlayerCameraLookAt(playerid, player_x,player_y,player_z);
    ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1); //smooth dancing. It's most fitting to the music
    PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.2238); //music, duh
    //making sure the timer gets executed only once, so the camera doesn't go to fast
    if (PlayerInfo[playerid][SpawnDance]) PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoveCamera", moving_speed, true, "i", playerid);
    PlayerInfo[playerid][SpawnDance] = false; //preventing the timer to execute again
    //------------------------------------------------

    TextDrawHideForPlayer(playerid, text_fadeblack[playerid]);
    TextDrawHideForPlayer(playerid, intro_gmname[playerid]);

    TextDrawShowForPlayer(playerid,WideScreenUp);
    TextDrawShowForPlayer(playerid,WideScreenDown);

    SetPlayerColor( playerid, COLOR_INACTIVE );

  switch(classid)
  {
    case 0..3: {
     GameTextForPlayer(playerid, "~n~~n~~w~]~b~~h~~h~Aztecas~w~]", 3000, 3);
    }
    case 4..7: {
     GameTextForPlayer(playerid, "~n~~n~~w~]~y~Vagos~w~]", 3000, 3);
    }
    case 8..11: {
     GameTextForPlayer(playerid, "~n~~n~~w~]~p~Ballas~w~]", 3000, 3);
    }
    case 12..15: {
     GameTextForPlayer(playerid, "~n~~n~~w~]~g~Grove Street Families~w~]", 3000, 3);
    }
    case 16..19: {
     GameTextForPlayer(playerid, "~n~~n~~w~]~p~~h~~h~Dealers~w~]", 3000, 3);
    }
    case 20..23: {
     GameTextForPlayer(playerid, "~n~~n~~w~]~b~Cops~w~]", 3000, 3);
    }
    case 24..27: {
     GameTextForPlayer(playerid, "~n~~n~~w~]~g~~h~~h~Bikers~w~]", 3000, 3);
    }
    case 28..31: {
     GameTextForPlayer(playerid, "~n~~n~~w~]~r~~h~~h~Rappers~w~]", 3000, 3);
    }
    case 32..35: {
     GameTextForPlayer(playerid, "~n~~n~~w~]~r~Hoodlums~w~]", 3000, 3);
    }
    case 36..39: {
     GameTextForPlayer( playerid, "~n~~n~~w~]~b~~h~Workers~w~]", 3000, 3 );
    }
    case 40..41: {
     GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~r~]~w~Admins~r~] ~n~~r~Admins Only!", 3000, 3);
    }
  }
  return 1;
}
Please help me..


Re: CJ on class selection!??!?! (weird thing, never seen before...) - leapfish - 24.05.2010

Anyone please help me..


Re: CJ on class selection!??!?! (weird thing, never seen before...) - DJDhan - 24.05.2010

I'm having the same problem although i never added the CJ skin -.-.Is it a bug in SA-MP ? But I don't see this bug too often in servers


Re: CJ on class selection!??!?! (weird thing, never seen before...) - iLcke - 24.05.2010

Same here, but it would have all skins CJ, when i dont even have CJ skin in the class selection.. But after i spawn it would be a skin from class selection..


Re: CJ on class selection!??!?! (weird thing, never seen before...) - leapfish - 24.05.2010

Anyone here that can actually solve our problems on this forum...

I want to hear some words from experienced scripters also....

As I can see I'm not the only one with this problem.. So please help us all!


Re: CJ on class selection!??!?! (weird thing, never seen before...) - leapfish - 24.05.2010

Alright guys, this thing is driving me crazy....
I've been trying for long time now, and I finally found out solution...

Код:
if(PlayerInfo[playerid][inIntro]) {
	  return 0;
}
As soon as I removed this code from the OnPlayerClassSelection, the CJ skin disappeared, so I guess that's what's wrong...

BUT THERE is still problem, now when I removed return 0; I can see class selection even when intro is going on...

Can anyone really help here...

So I needed to remove that part, but now I can see class selection when in intro... I guess it has to stay return 0; but then CJ comes...


Re: CJ on class selection!??!?! [Almost solved, PLEASE check!!] - leapfish - 25.05.2010

Anyone yet found out problem, what's wrong with return 0; ?


Re: CJ on class selection!??!?! [Almost solved, PLEASE check!!] - leapfish - 25.05.2010

Please, help me... Anyone?


Re: CJ on class selection!??!?! [Almost solved, PLEASE check!!] - leapfish - 02.06.2010

Still have the same problem, and few other guys... is this SAMP bug or what? and how to get rid of it... Please some experienced scripters help...


Re: CJ on class selection!??!?! [Almost solved, PLEASE check!!] - leapfish - 02.06.2010

Bump, help needed...


Re: CJ on class selection!??!?! [Almost solved, PLEASE check!!] - DJDhan - 02.06.2010

OKAY, I had this problem too and I fixed it.

Here's the solution: Use AddPlayerClassEx instead of AddPlayerClass.


Re: CJ on class selection!??!?! [Almost solved, PLEASE check!!] - leapfish - 02.06.2010

Quote:
Originally Posted by DJDhan
OKAY, I had this problem too and I fixed it.

Here's the solution: Use AddPlayerClassEx instead of AddPlayerClass.
If you check first page where I posted the code... I use it already.. so it's not the problem


Re: CJ on class selection!??!?! [Almost solved, PLEASE check!!] - azzerking - 02.06.2010

Ive had this problem i reinstalled pawno and it worked but in case it doesn't for you i would try Copying and pasting little bist in a new script and testing them until u find the problem with the bit then ask to solve it


Re: CJ on class selection!??!?! [Almost solved, PLEASE check!!] - leapfish - 02.06.2010

Quote:
Originally Posted by Azzerking
Ive had this problem i reinstalled pawno and it worked but in case it doesn't for you i would try Copying and pasting little bist in a new script and testing them until u find the problem with the bit then ask to solve it
I found what's the problem, but I don't know how to fix it....

Код:
if(PlayerInfo[playerid][inIntro]) {
	  return 0;
}
As soon as I remove this, it's fixed, but then intro is fucked...




Re: CJ on class selection!??!?! [Almost solved, PLEASE check!!] - DJDhan - 03.06.2010

Quote:
Originally Posted by Wyett
Quote:
Originally Posted by Azzerking
Ive had this problem i reinstalled pawno and it worked but in case it doesn't for you i would try Copying and pasting little bist in a new script and testing them until u find the problem with the bit then ask to solve it
I found what's the problem, but I don't know how to fix it....

Код:
if(PlayerInfo[playerid][inIntro]) {
	  return 0;
}
As soon as I remove this, it's fixed, but then intro is fucked...

Under which funtion have you put this?