Multiple spawn locations
#1

Hi, I want to set it so that my 2 spawn locations show the location of the spawn in class selection. Right now it only shows the 2 classes in my ganton spawn location. I'd like the Ballas spawn to show at the greenbottles location. Do I have to set up the cam angle? and how do I go about doing that with 2 spawns? Or teams?
Код:
public OnGameModeInit()
{

	SetGameModeText("Ryan's Script");
	//classes
	AddPlayerClass(105,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
	AddPlayerClass(106,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
	AddPlayerClass(107,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
	AddPlayerClass(102,2304.9680,-1652.6714,14.4692,179.8481,24,250,27,250,30,300); // green bottles spawn loc
    AddPlayerClass(103,2304.9680,-1652.6714,14.4692,179.8481,24,250,27,250,30,300); // green bottles spawn loc
    AddPlayerClass(104,2304.9680,-1652.6714,14.4692,179.8481,24,250,27,250,30,300); // green bottles spawn loc
	//vehicles
	AddStaticVehicle(529,2435.1013,-1653.6965,13.0872,91.0876,42,42); // willard car near grove bridge
	AddStaticVehicle(529,2174.5579,-1631.6096,14.3125,76.5158,42,42); // willard across street from binco
	AddStaticVehicle(536,2409.5146,-1664.2186,13.1985,268.6294,12,1); // blade near pole ganton bridge
	AddStaticVehicle(536,2509.3828,-1671.7753,13.1396,350.0872,12,1); // blade near cj garage
	AddStaticVehicle(522,2387.0464,-1663.9783,13.0410,267.5524,6,25); // NRG near ganton
	AddStaticVehicle(522,2507.1743,-1694.7504,13.1306,356.7531,6,25); // nrg in cj house garage
	AddStaticVehicle(522,2296.1838,-1640.3344,14.3374,226.5287,6,25); // Green bottles car
	AddStaticVehicle(409,2304.4858,-1635.9442,14.0725,179.6976,6,25); // Green bottles stretch
    UsePlayerPedAnims();
	return 1;
}

public OnGameModeExit()
{
	return 1;
}
public OnPlayerRequestClass (playerid, classid)
{
	SetPlayerPos(playerid, 2498.8213,-1684.5753,13.4179);
    SetPlayerCameraPos(playerid, 2497.7188,-1680.2167,13.3547);
    SetPlayerCameraLookAt(playerid, 2498.5054,-1684,13.3547);
    SetPlayerFacingAngle (playerid, 12.5838);
	return 1;
}
Reply
#2

You need to get the classid:
pawn Код:
/*Class ID 0*/AddPlayerClass(105,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
    /*Class ID 1*/AddPlayerClass(106,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
    /*Class ID 2*/AddPlayerClass(107,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
    /*Class ID 3*/AddPlayerClass(102,2304.9680,-1652.6714,14.4692,179.8481,24,250,27,250,30,300); // green bottles spawn loc
    /*Class ID 4*/AddPlayerClass(103,2304.9680,-1652.6714,14.4692,179.8481,24,250,27,250,30,300); // green bottles spawn loc
    /*Class ID 5*/AddPlayerClass(104,2304.9680,-1652.6714,14.4692,179.8481,24,250,27,250,30,300); // green bottles spawn loc
Then use that classid, so basically, ballas are class IDs 3-5. Grove classids are 0-2.
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0..2: //if the class id is 0 to 2, AKA Grove
        {
            SetPlayerPos(playerid, 2498.8213,-1684.5753,13.4179); //Grove position
            SetPlayerCameraPos(playerid, 2497.7188,-1680.2167,13.3547); //Grove camera
            SetPlayerCameraLookAt(playerid, 2498.5054,-1684,13.3547); //Grove position
            SetPlayerFacingAngle (playerid, 12.5838); //Grove angle
        }
        case 3..5: //if the class id is 3 to 5, AKA Ballas
        {
            SetPlayerPos(playerid, X, Y, Z); //Ballas Position
            SetPlayerCameraPos(playerid, X, Y, Z); //Ballas Camera
            SetPlayerCameraLookAt(playerid, X, Y, Z); //Ballas Position
            SetPlayerFacingAngle (playerid, Angle); //Ballas Angle
        }
    }
    return 1;
}
Obviously, replace X, Y and Z with the appropriate coordinates for the Ballas team, and replace Angle with the appropriate facing angle for the ballas team. Hope this kinda helped you understand it.
Reply
#3

Код:
public OnGameModeInit()
{

	SetGameModeText("Ryan's Script");
	//classes
    /*Class ID 0*/AddPlayerClass(105,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
    /*Class ID 1*/AddPlayerClass(106,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
    /*Class ID 2*/AddPlayerClass(107,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
    /*Class ID 3*/AddPlayerClass(2304.2261,-1650.4573,14.5472,178.9947,24,250,27,250,30,300); // green bottles spawn loc
    /*Class ID 4*/AddPlayerClass(2304.2261,-1650.4573,14.5472,178.9947,24,250,27,250,30,300); // green bottles spawn loc
    /*Class ID 5*/AddPlayerClass(2304.2261,-1650.4573,14.5472,178.9947,24,250,27,250,30,300); // green bottles spawn loc
	//vehicles
	AddStaticVehicle(529,2435.1013,-1653.6965,13.0872,91.0876,42,42); // willard car near grove bridge
	AddStaticVehicle(529,2174.5579,-1631.6096,14.3125,76.5158,42,42); // willard across street from binco
	AddStaticVehicle(536,2409.5146,-1664.2186,13.1985,268.6294,12,1); // blade near pole ganton bridge
	AddStaticVehicle(536,2509.3828,-1671.7753,13.1396,350.0872,12,1); // blade near cj garage
	AddStaticVehicle(522,2387.0464,-1663.9783,13.0410,267.5524,6,25); // NRG near ganton
	AddStaticVehicle(522,2507.1743,-1694.7504,13.1306,356.7531,6,25); // nrg in cj house garage
	AddStaticVehicle(522,2296.1838,-1640.3344,14.3374,226.5287,6,25); // Green bottles car
	AddStaticVehicle(409,2304.4858,-1635.9442,14.0725,179.6976,6,25); // Green bottles stretch
    UsePlayerPedAnims();
	return 1;
}

public OnGameModeExit()
{
	return 1;
}
public OnPlayerRequestClass (playerid, classid)
{
public OnPlayerRequestClass(playerid, classid)
    switch(classid)
    {
        case 0..2 //if the class id is 0 to 2, AKA Grove
		{
			SetPlayerPos(playerid, 2498.8213,-1684.5753,13.4179); //Grove position
            SetPlayerCameraPos(playerid, 2497.7188,-1680.2167,13.3547); //Grove camera
            SetPlayerCameraLookAt(playerid, 2498.5054,-1684,13.3547); //Grove position
            SetPlayerFacingAngle (playerid, 12.5838); //Grove angle
        }
        case 3..5: //if the class id is 3 to 5, AKA Ballas
        {
            SetPlayerPos(playerid, 2304.2261,-1650.4573,14.5472); //Ballas Position
            SetPlayerCameraPos(playerid, 2304.2261,-1650.4573,14.5472); //Ballas Camera
            SetPlayerCameraLookAt(playerid, 2304.3811,-1655.1173,14.4548); //Ballas Position
            SetPlayerFacingAngle (playerid, 178.9947); //Ballas Angle
   	  	}
    return 1;
}
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(14) : warning 217: loose indentation
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(17) : warning 213: tag mismatch
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(17) : warning 202: number of arguments does not match definition
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(1 : warning 213: tag mismatch
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(1 : warning 202: number of arguments does not match definition
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(19) : warning 213: tag mismatch
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(19) : warning 202: number of arguments does not match definition
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(21) : warning 217: loose indentation
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(39) : error 029: invalid expression, assumed zero
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(40) : error 001: expected token: ";", but found "switch"
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(40) : warning 217: loose indentation
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(42 -- 43) : error 029: invalid expression, assumed zero
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(56) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(56) : warning 215: expression has no effect
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

replace it
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    switch(
classid)
    {
        case 
0..2 //if the class id is 0 to 2, AKA Grove
        
{
            
SetPlayerPos(playerid2498.8213,-1684.5753,13.4179); //Grove position
            
SetPlayerCameraPos(playerid2497.7188,-1680.2167,13.3547); //Grove camera
            
SetPlayerCameraLookAt(playerid2498.5054,-1684,13.3547); //Grove position
            
SetPlayerFacingAngle (playerid12.5838); //Grove angle
        
}
        case 
3..5//if the class id is 3 to 5, AKA Ballas
        
{
            
SetPlayerPos(playerid2304.2261,-1650.4573,14.5472); //Ballas Position
            
SetPlayerCameraPos(playerid2304.2261,-1650.4573,14.5472); //Ballas Camera
            
SetPlayerCameraLookAt(playerid2304.3811,-1655.1173,14.4548); //Ballas Position
            
SetPlayerFacingAngle (playerid178.9947); //Ballas Angle
        
}
    }
    return 
1;

Reply
#5

Quote:
Originally Posted by Mr_Zlodei
Посмотреть сообщение
replace it
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    switch(
classid)
    {
        case 
0..2 //if the class id is 0 to 2, AKA Grove
        
{
            
SetPlayerPos(playerid2498.8213,-1684.5753,13.4179); //Grove position
            
SetPlayerCameraPos(playerid2497.7188,-1680.2167,13.3547); //Grove camera
            
SetPlayerCameraLookAt(playerid2498.5054,-1684,13.3547); //Grove position
            
SetPlayerFacingAngle (playerid12.5838); //Grove angle
        
}
        case 
3..5//if the class id is 3 to 5, AKA Ballas
        
{
            
SetPlayerPos(playerid2304.2261,-1650.4573,14.5472); //Ballas Position
            
SetPlayerCameraPos(playerid2304.2261,-1650.4573,14.5472); //Ballas Camera
            
SetPlayerCameraLookAt(playerid2304.3811,-1655.1173,14.4548); //Ballas Position
            
SetPlayerFacingAngle (playerid178.9947); //Ballas Angle
        
}
    }
    return 
1;

C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(14) : warning 217: loose indentation
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(17) : warning 213: tag mismatch
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(17) : warning 202: number of arguments does not match definition
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(1 : warning 213: tag mismatch
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(1 : warning 202: number of arguments does not match definition
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(19) : warning 213: tag mismatch
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(19) : warning 202: number of arguments does not match definition
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(21) : warning 217: loose indentation
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(39) : error 029: invalid expression, assumed zero
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(40) : error 001: expected token: ";", but found "{"
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(43 -- 44) : error 029: invalid expression, assumed zero
C:\Users\Ryan\SkyDrive\Documents\Scripting\gamemod es\Ryan.pwn(62) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#6

PHP код:
public OnGameModeInit()
{
    
SetGameModeText("Ryan's Script");
    
//classes
    /*Class ID 0*/
    
AddPlayerClass(105,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
    /*Class ID 1*/
    
AddPlayerClass(106,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
    /*Class ID 2*/
    
AddPlayerClass(107,2498.5054,-1684.9028,13.4242,19.7164,24,250,27,250,30,300); // Grove spawn
    /*Class ID 3*/
    
AddPlayerClass(/*select id*/2304.2261,-1650.4573,14.5472,178.9947,24,250,27,250,30,300); // green bottles spawn loc
    /*Class ID 4*/
    
AddPlayerClass(/*select id*/2304.2261,-1650.4573,14.5472,178.9947,24,250,27,250,30,300); // green bottles spawn loc
    /*Class ID 5*/
    
AddPlayerClass(/*select id*/2304.2261,-1650.4573,14.5472,178.9947,24,250,27,250,30,300); // green bottles spawn loc
    //vehicles
    
AddStaticVehicle(529,2435.1013,-1653.6965,13.0872,91.0876,42,42); // willard car near grove bridge
    
AddStaticVehicle(529,2174.5579,-1631.6096,14.3125,76.5158,42,42); // willard across street from binco
    
AddStaticVehicle(536,2409.5146,-1664.2186,13.1985,268.6294,12,1); // blade near pole ganton bridge
    
AddStaticVehicle(536,2509.3828,-1671.7753,13.1396,350.0872,12,1); // blade near cj garage
    
AddStaticVehicle(522,2387.0464,-1663.9783,13.0410,267.5524,6,25); // NRG near ganton
    
AddStaticVehicle(522,2507.1743,-1694.7504,13.1306,356.7531,6,25); // nrg in cj house garage
    
AddStaticVehicle(522,2296.1838,-1640.3344,14.3374,226.5287,6,25); // Green bottles car
    
AddStaticVehicle(409,2304.4858,-1635.9442,14.0725,179.6976,6,25); // Green bottles stretch
    
UsePlayerPedAnims();
    return 
1;
}
public 
OnGameModeExit()
{
    return 
1;
}
public 
OnPlayerRequestClass (playeridclassid)
{
    switch(
classid)
    {
        case 
0..2//if the class id is 0 to 2, AKA Grove
        
{
            
SetPlayerPos(playerid2498.8213,-1684.5753,13.4179); //Grove position
            
SetPlayerCameraPos(playerid2497.7188,-1680.2167,13.3547); //Grove camera
            
SetPlayerCameraLookAt(playerid2498.5054,-1684,13.3547); //Grove position
            
SetPlayerFacingAngle (playerid12.5838); //Grove angle
        
}
        case 
3..5//if the class id is 3 to 5, AKA Ballas
        
{
            
SetPlayerPos(playerid2304.2261,-1650.4573,14.5472); //Ballas Position
            
SetPlayerCameraPos(playerid2304.2261,-1650.4573,14.5472); //Ballas Camera
            
SetPlayerCameraLookAt(playerid2304.3811,-1655.1173,14.4548); //Ballas Position
            
SetPlayerFacingAngle (playerid178.9947); //Ballas Angle
        
}
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)