class select - 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: class select (
/showthread.php?tid=111043)
class select -
XRVX - 29.11.2009
how can i make it
that whenn they choose one sort of class
they spawn at diffrent places
i mean one in that corner and one in that corner
not all at the same place?
Re: class select -
DeathOnaStick - 29.11.2009
Do you want to let a team spawn in an other area than the other, or do you want to modify "AddPlayerClass" ? Do you want those places to be randomly set?
Re: class select -
XRVX - 29.11.2009
ye randomly spawning
Re: class select -
[NYRP]Mike. - 29.11.2009
Right so you want them to spawn randomly in a custom position e.g interior or?? like SF, LV & LS?
Re: class select -
DeathOnaStick - 29.11.2009
pawn Код:
public OnPlayerSpawn(playerid)
{
new randomspawn=random(5);
if(GetPlayerTeam(playerid)==BALLAS)
{
switch(randomspawn)
{
case 0: SetPlayerPos(playerid, X, Y, Z);
case 1: SetPlayerPos(playerid, X, Y, Z);
case 2: SetPlayerPos(playerid, X, Y, Z);
case 3: SetPlayerPos(playerid, X, Y, Z);
case 4: SetPlayerPos(playerid, X, Y, Z);
case 5: SetPlayerPos(playerid, X, Y, Z);
}
}
else if(GetPlayerTeam(playerid)==GROVE)
{
switch(randomspawn)
{
case 0: SetPlayerPos(playerid, X, Y, Z);
case 1: SetPlayerPos(playerid, X, Y, Z);
case 2: SetPlayerPos(playerid, X, Y, Z);
case 3: SetPlayerPos(playerid, X, Y, Z);
case 4: SetPlayerPos(playerid, X, Y, Z);
case 5: SetPlayerPos(playerid, X, Y, Z);
}
}
return 1;
}
Like this?
Re: class select -
XRVX - 29.11.2009
Quote:
Originally Posted by ♣ ©ⓤⓝⓔⓞ ♣
Right so you want them to spawn randomly in a custom position e.g interior or?? like SF, LV & LS?
|
yes i want for example this
Spawn1
x=-1637.3399
y=674.1799
z=7.1875
angle=260.0000
Location Name: Interior-0
Spawn2
x=-1600.3358
y=650.8590
z=7.1875
angle=356.8209
Location Name: Interior-0
Spawn3
x=-1579.5858
y=673.4845
z=7.1901
angle=142.5223
Location Name: Interior-0
with 3 skins
and if they choose one of the skins
they will be placed randomly on one of the 3 spawnplaces
Re: class select -
DeathOnaStick - 29.11.2009
pawn Код:
public OnPlayerSpawn(playerid)
{
if(GetPlayerSkin(playerid)==1 || GetPlayerSkin(playerid)==2 || GetPlayerSkin(playerid)==3)
{
new randspwn(2);
switch(randspwn)
{
case 0: SetPlayerPos(playerid, -1637.3399, 674.1799 , 7.1875);
case 1: SetPlayerPos(playerid, -1600.3358, 650.8590, 7.1875);
case 2: SetPlayerPos(playerid, -1579.5858, 673.4845, 7.1901);
}
}
return 1;
}
That should fit.
Re: class select -
XRVX - 29.11.2009
ok i will try it thanks
Re: class select -
Kuba_PL - 29.11.2009
Nice code, and now if You're switching between classes (in class selection screen) then
how to do that You see the class is currently showing (i mean whit textdraw)
Re: class select -
DeathOnaStick - 29.11.2009
Quote:
Originally Posted by Kuba_PL
Nice code, and now if You're switching between classes (in class selection screen) then
how to do that You see the class is currently showing (i mean whit textdraw)
|
That should be under OnPlayerRequestSpawn. You can switch threw the skins or the teams then.