Player Spawn
#1

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?
Reply
#2

How many different places do you want?
Reply
#3

like 7 places
Reply
#4

there is no auto work.....
Reply
#5

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.
Reply
#6

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
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)