Player Spawn - 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)
+--- Thread: Player Spawn (
/showthread.php?tid=365988)
Player Spawn -
DarkB0y - 04.08.2012
Hello,
Well i was try to make the player have a different spawn player i have put
Код:
AddPlayerClass(2,1516.1912,-1656.9117,13.5392,268.2489,0,0,0,0,0,0);
AddPlayerClass(3,5314,-124.17,642,778842,0,0,0,0,0,0);
But this will take alot of time in 299 skin
any easy way to get the player spawn in different places?
Re: Player Spawn -
DeathOnaStick - 04.08.2012
How many different places do you want?
Re: Player Spawn -
DarkB0y - 04.08.2012
like 7 places
Re: Player Spawn -
LaGrande - 04.08.2012
there is no auto work.....
Re: Player Spawn -
DeathOnaStick - 04.08.2012
You can do it like this:
pawn Код:
for(new i=0; i<=299; i++){
if(i>=0&&i<100){ //IDs 0 to 99
AddPlayerClass(i,1516.1912,-1656.9117,13.5392,268.2489,0,0,0,0,0,0); //place a
}
else if(i>=100&&i<=299){ //IDs 100 to 299
AddPlayerClass(i,5314,-124.17,642,778842,0,0,0,0,0,0); //place b
}
}
This is how I would do it.
Quote:
Originally Posted by LaGrande
there is no auto work.....
|
Sure there is. Everything can be automized, welcome to the world of computers.
Re: Player Spawn -
DarkB0y - 04.08.2012
but if it like this if player selected a skin in 100 he will spawn in the same place i was trying like if player select a skin first time he will spawn in place than if he select it again he will spawn in another place
Re: Player Spawn -
DeathOnaStick - 05.08.2012
Quote:
Originally Posted by X_Boy
but if it like this if player selected a skin in 100 he will spawn in the same place i was trying like if player select a skin first time he will spawn in place than if he select it again he will spawn in another place
|
pawn Код:
public OnPlayerSpawn(playerid){
switch(GetPVarInt(playerid, "times_spawned")){
case 0:{
SetPlayerPos(playerid, x_position1, y_position1, z_position1);
SetPVarInt(playerid, "times_spawned", GetPVarInt(playerid, "times_spawned")+1);
}
case 1:{
SetPlayerPos(playerid, x_position2, y_position2, z_position2);
SetPVarInt(playerid, "times_spawned", GetPVarInt(playerid, "times_spawned")+1);
}
case 2:{
SetPlayerPos(playerid, x_position3, y_position3, z_position3);
SetPVarInt(playerid, "times_spawned", GetPVarInt(playerid, "times_spawned")+1);
}
default:{ //if this doesn't work try: "case default:"
SetPlayerPos(playerid, x_position4, y_position4, z_position4);
SetPVarInt(playerid, "times_spawned", 0);
}
}
return 1;
}
You can add as many positions as you want.