SA-MP Forums Archive
onplayerrequestclass problem - 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: onplayerrequestclass problem (/showthread.php?tid=127725)



onplayerrequestclass problem - ruckfules99 - 14.02.2010

During character selection (onplayerrequestclass) how can i make it that the selection backround is not the same for each character skin?


Like for example:

COP SKIN: (backround is at lspd), Then i go 1 to the right MEDIC: (backround is infront of the hospital)



I know this isnt the best example and some of you might not understand....for those who do, how can i do this?


Re: onplayerrequestclass problem - [HiC]TheKiller - 14.02.2010

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
  if(Classid == /*Number here*/)
  {
    //Set the player camera pos and player pos at a different placed.
  }
  return 1;
}



Re: onplayerrequestclass problem - Fedee! - 14.02.2010

Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
  if(Classid == /*Number here*/)
  {
    //Set the player camera pos and player pos at a different placed.
  }
  return 1;
}
Here an example:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(Classid == /*Number here*/)
   
    {
        SetPlayerInterior(playerid,0);
        SetPlayerPos(playerid,x,y,z);//Pos of the character
        SetPlayerFacingAngle(playerid,angle);//Angle of character
        LoopingAnim(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0);//Animation
        SetPlayerCameraPos(playerid, x,y,z);//Change this
        SetPlayerCameraLookAt(playerid,x,y,z);//Change this
       
    }
    return 1;
}
EDIT: Sorry, something wrong, now its okay


Re: onplayerrequestclass problem - ruckfules99 - 14.02.2010

Thanks for the replys but i'm not good at onplayerrequestclass......



but when i do

Код:
public OnPlayerRequestClass(playerid, classid)
{
	if(Classid == /*Number here*/)
	
	{
		SetPlayerInterior(playerid,0);
		SetPlayerPos(playerid,x,y,z);//Pos of the character
		SetPlayerFacingAngle(playerid,angle);//Angle of character
		LoopingAnim(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0);//Animation
		SetPlayerCameraPos(playerid, x,y,z);//Change this
		SetPlayerCameraLookAt(playerid,x,y,z);//Change this
		
	}
	return 1;
}
It says "undefined symbol classid"


plus how do i add more then 1 class id?


Re: onplayerrequestclass problem - snoob - 15.02.2010

CAPITAL C and small c ... make both "classid" same ...


Re: onplayerrequestclass problem - ruckfules99 - 15.02.2010

Ok heres my Onplayerrequestclass:

Код:
public OnPlayerRequestClass(playerid, classid)
{
	if(classid == 0,1,2,3,4,5,6,7,9,10,11,12)

	{
	SetPlayerPos(playerid, 1529.1810, -1677.3951, 5.8906);
	SetPlayerInterior(playerid, 0);
	SetPlayerFacingAngle(playerid, 45.3003);
	SetPlayerCameraPos(playerid, 1525.6810, -1673.3951, 7.3906);
	SetPlayerCameraLookAt(playerid, 1529.1810, -1677.3951, 5.8906);
	}
	else if(classid == 10)
	{
	SetPlayerPos(playerid, 2723.9865, -2412.3259, 29.6615);
	SetPlayerInterior(playerid, 0);
	SetPlayerFacingAngle(playerid, 33.4930);
	SetPlayerCameraPos(playerid, 2720.4865, -2408.3259, 31.1615);
	SetPlayerCameraLookAt(playerid, 2723.9865, -2412.3259, 29.6615);
	}
	else if(classid == 14)
	{
	SetPlayerPos(playerid, 1482.1323, -1765.6755, 18.7957);
	SetPlayerInterior(playerid, 0);
	SetPlayerFacingAngle(playerid, 46.4726);
	SetPlayerCameraPos(playerid, 1478.6323, -1761.6755, 20.2957);
	SetPlayerCameraLookAt(playerid, 1482.1323, -1765.6755, 18.7957);
	}
	else if(classid == 15)
	{
	SetPlayerPos(playerid, 1070.1849, -1680.1513, 27.2890);
	SetPlayerInterior(playerid, 0);
	SetPlayerFacingAngle(playerid, 33.6026);
	SetPlayerCameraPos(playerid, 1066.6849, -1676.1513, 28.7890);
	SetPlayerCameraLookAt(playerid, 1070.1849, -1680.1513, 27.2890);
	}
	else if(classid == 16)
	{
	SetPlayerPos(playerid, 1479.7327, -1788.8096, 156.7533);
	SetPlayerInterior(playerid, 0);
	SetPlayerFacingAngle(playerid, 48.7935);
	SetPlayerCameraPos(playerid, 1476.2327, -1784.8096, 158.2533);
	SetPlayerCameraLookAt(playerid, 1479.7327, -1788.8096, 156.7533);
	}
	else if(classid == 17,18)
	{
	SetPlayerPos(playerid, 1473.4134, -2285.6518, 42.4204);
	SetPlayerInterior(playerid, 0);
	SetPlayerFacingAngle(playerid, 35.6807);
	SetPlayerCameraPos(playerid, 1469.9134, -2281.6518, 43.9204);
	SetPlayerCameraLookAt(playerid, 1473.4134, -2285.6518, 42.4204);
	}
	else if(classid == 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63)
	{
	SetPlayerPos(playerid, 1473.4134, -2285.6518, 42.4204);
	SetPlayerInterior(playerid, 0);
	SetPlayerFacingAngle(playerid, 35.6807);
	SetPlayerCameraPos(playerid, 1469.9134, -2281.6518, 43.9204);
	SetPlayerCameraLookAt(playerid, 1473.4134, -2285.6518, 42.4204);
	}
 	switch (classid) {

		case 0,1,2,3,4,5,6:

		  {

				GameTextForPlayer(playerid, "~b~POLICE OFFICER~n~~w~CITY OFFICER", 3000, 5);

			}

		case 7:

	    {

				GameTextForPlayer(playerid, "~b~POLICE OFFICER~n~~w~FBI", 3000, 5);

			}

		case 8:

	    {

				GameTextForPlayer(playerid, "~b~SA ARMY OFFICER~n~~w~DEADLY FORCE SQUAD", 3000, 5);

			}

    case 9:

	    {

				GameTextForPlayer(playerid, "~w~CASINO SECURITY", 3000, 5);

			}

	  case 10:

	    {

				GameTextForPlayer(playerid, "~b~POLICE OFFICER~n~~w~CASUAL CLOTHES", 3000, 5);

			}

		case 11:

	    {

				GameTextForPlayer(playerid, "~b~POLICE OFFICER~n~~w~AIR SUPPORT", 3000, 5);

			}

		case 12:

	    {

				GameTextForPlayer(playerid, "~b~POLICE OFFICER~n~~w~MARINE SUPPORT", 3000, 5);

			}

		case 13:

	    {

				GameTextForPlayer(playerid, "~b~JAIL TURNKEY", 3000, 5);
      }

		case 14:

	    {

				GameTextForPlayer(playerid, "~b~MEDIC", 3000, 5);

			}

		case 15:

	    {

				GameTextForPlayer(playerid, "~w~CAR MECHANIC", 3000, 5);

			}

		case 16:

	    {

				GameTextForPlayer(playerid, "~w~BISTRO STAFF", 3000, 5);

			}

		case 17,18:

	    {

				GameTextForPlayer(playerid, "~g~TAXI DRIVER", 3000, 5);

			}
		case 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63:

	    {

				GameTextForPlayer(playerid, "~w~CIVILIAN~b~~n~CHOOSE A JOB WHEN YOU SPAWN", 3000, 5);

			}

}
	return 1;
}
Why is it that my classes do not have different backrounds? It says as the first one......



I also get warnings, I'm not sure what i did wrong....

Код:
 redundant test: constant expression is non-zero //line 
 redundant test: constant expression is non-zero
 redundant test: constant expression is non-zero




Re: onplayerrequestclass problem - Fedee! - 15.02.2010

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
  if(classid == (0,1,2,3,4,5,6,7,9,10,11,12)) {
    SetPlayerPos(playerid, 1529.1810, -1677.3951, 5.8906);
    SetPlayerInterior(playerid, 0);
    SetPlayerFacingAngle(playerid, 45.3003);
    SetPlayerCameraPos(playerid, 1525.6810, -1673.3951, 7.3906);
    SetPlayerCameraLookAt(playerid, 1529.1810, -1677.3951, 5.8906);
  }
  else if(classid == 10) {
    SetPlayerPos(playerid, 2723.9865, -2412.3259, 29.6615);
    SetPlayerInterior(playerid, 0);
    SetPlayerFacingAngle(playerid, 33.4930);
    SetPlayerCameraPos(playerid, 2720.4865, -2408.3259, 31.1615);
    SetPlayerCameraLookAt(playerid, 2723.9865, -2412.3259, 29.6615);
  }
  else if(classid == 14) {
    SetPlayerPos(playerid, 1482.1323, -1765.6755, 18.7957);
    SetPlayerInterior(playerid, 0);
    SetPlayerFacingAngle(playerid, 46.4726);
    SetPlayerCameraPos(playerid, 1478.6323, -1761.6755, 20.2957);
    SetPlayerCameraLookAt(playerid, 1482.1323, -1765.6755, 18.7957);
  }
  else if(classid == 15) {
    SetPlayerPos(playerid, 1070.1849, -1680.1513, 27.2890);
    SetPlayerInterior(playerid, 0);
    SetPlayerFacingAngle(playerid, 33.6026);
    SetPlayerCameraPos(playerid, 1066.6849, -1676.1513, 28.7890);
    SetPlayerCameraLookAt(playerid, 1070.1849, -1680.1513, 27.2890);
  }
  else if(classid == 16) {
    SetPlayerPos(playerid, 1479.7327, -1788.8096, 156.7533);
    SetPlayerInterior(playerid, 0);
    SetPlayerFacingAngle(playerid, 48.7935);
    SetPlayerCameraPos(playerid, 1476.2327, -1784.8096, 158.2533);
    SetPlayerCameraLookAt(playerid, 1479.7327, -1788.8096, 156.7533);
  }
  else if(classid == (17,18)) {
    SetPlayerPos(playerid, 1473.4134, -2285.6518, 42.4204);
    SetPlayerInterior(playerid, 0);
    SetPlayerFacingAngle(playerid, 35.6807);
    SetPlayerCameraPos(playerid, 1469.9134, -2281.6518, 43.9204);
    SetPlayerCameraLookAt(playerid, 1473.4134, -2285.6518, 42.4204);
  }
  else if(classid == (19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63)) {
    SetPlayerPos(playerid, 1473.4134, -2285.6518, 42.4204);
    SetPlayerInterior(playerid, 0);
    SetPlayerFacingAngle(playerid, 35.6807);
    SetPlayerCameraPos(playerid, 1469.9134, -2281.6518, 43.9204);
    SetPlayerCameraLookAt(playerid, 1473.4134, -2285.6518, 42.4204);
  }
  switch (classid) {

    case 0,1,2,3,4,5,6:

      {

        GameTextForPlayer(playerid, "~b~POLICE OFFICER~n~~w~CITY OFFICER", 3000, 5);

      }

    case 7:

      {

        GameTextForPlayer(playerid, "~b~POLICE OFFICER~n~~w~FBI", 3000, 5);

      }

    case 8:

      {

        GameTextForPlayer(playerid, "~b~SA ARMY OFFICER~n~~w~DEADLY FORCE SQUAD", 3000, 5);

      }

    case 9:

      {

        GameTextForPlayer(playerid, "~w~CASINO SECURITY", 3000, 5);

      }

    case 10:

      {

        GameTextForPlayer(playerid, "~b~POLICE OFFICER~n~~w~CASUAL CLOTHES", 3000, 5);

      }

    case 11:

      {

        GameTextForPlayer(playerid, "~b~POLICE OFFICER~n~~w~AIR SUPPORT", 3000, 5);

      }

    case 12:

      {

        GameTextForPlayer(playerid, "~b~POLICE OFFICER~n~~w~MARINE SUPPORT", 3000, 5);

      }

    case 13:

      {

        GameTextForPlayer(playerid, "~b~JAIL TURNKEY", 3000, 5);
      }

    case 14:

      {

        GameTextForPlayer(playerid, "~b~MEDIC", 3000, 5);

      }

    case 15:

      {

        GameTextForPlayer(playerid, "~w~CAR MECHANIC", 3000, 5);

      }

    case 16:

      {

        GameTextForPlayer(playerid, "~w~BISTRO STAFF", 3000, 5);

      }

    case 17,18:

      {

        GameTextForPlayer(playerid, "~g~TAXI DRIVER", 3000, 5);

      }
    case 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63:

      {

        GameTextForPlayer(playerid, "~w~CIVILIAN~b~~n~CHOOSE A JOB WHEN YOU SPAWN", 3000, 5);

      }

  }
  return 1;
}
Now works fine, you were missing some ( and ), and fixed your indetation.