20.09.2010, 02:09
Como hago para escojer el lugar en donde aparezeran los jugadores es chimbo que aparezcan todos en el mismo sitio
public OnPlayerSpawn(playerid)
{
new rspawn = random(4);
switch(rspawn){
case 0: SetPlayerPos(playerid, 0.0, 0.0, 0.0);
case 1: SetPlayerPos(playerid, 0.0, 0.0, 0.0);
case 2: SetPlayerPos(playerid, 0.0, 0.0, 0.0);
case 3: SetPlayerPos(playerid, 0.0, 0.0, 0.0);
}
return 1;
}
aca tenes un codigo base.
pawn Код:
cualquier duda preguntame |
public OnPlayerSpawn(playerid)
{
new rspawn = random(4);
switch(rspawn){
case 0:{SetPlayerPos(playerid, 0.0, 0.0, 0.0);}
case 1:{SetPlayerPos(playerid, 0.0, 0.0, 0.0);}
case 2:{SetPlayerPos(playerid, 0.0, 0.0, 0.0);}
case 3:{SetPlayerPos(playerid, 0.0, 0.0, 0.0);}
}
return 1;
}
new Spawn[MAX_PLAYERS];
new Float:gRandomPlayerSpawns[23][3] = {
{1958.3783,1343.1572,15.3746},
{2199.6531,1393.3678,10.8203},
{2483.5977,1222.0825,10.8203},
{2637.2712,1129.2743,11.1797},
{2000.0106,1521.1111,17.0625},
{2024.8190,1917.9425,12.3386},
{2261.9048,2035.9547,10.8203},
{2262.0986,2398.6572,10.8203},
{2244.2566,2523.7280,10.8203},
{2335.3228,2786.4478,10.8203},
{2150.0186,2734.2297,11.1763},
{2158.0811,2797.5488,10.8203},
{1969.8301,2722.8564,10.8203},
{1652.0555,2709.4072,10.8265},
{1564.0052,2756.9463,10.8203},
{1271.5452,2554.0227,10.8203},
{1441.5894,2567.9099,10.8203},
{1480.6473,2213.5718,11.0234},
{1400.5906,2225.6960,11.0234},
{1598.8419,2221.5676,11.0625},
{1318.7759,1251.3580,10.8203},
{1558.0731,1007.8292,10.8125},
{1705.2347,1025.6808,10.8203}
};
new Float:gCopPlayerSpawns[2][3] = {
{2297.1064,2452.0115,10.8203},
{2297.0452,2468.6743,10.8203}
};
public OnPlayerSpawn(playerid)
{
SetPlayerRandomSpawn(playerid);
return 1;
}
public SetPlayerRandomSpawn(playerid)
{
if (Spawn[playerid] == 1)
{
new rand = random(sizeof(gCopPlayerSpawns));
SetPlayerPos(playerid,
gCopPlayerSpawns[rand][0],
gCopPlayerSpawns[rand][1],
gCopPlayerSpawns[rand][2]);
SetPlayerFacingAngle(playerid, 270.0);
}
else if (Spawn[playerid] == 0)
{
new rand = random(sizeof(gRandomPlayerSpawns));
SetPlayerPos(playerid,
gRandomPlayerSpawns[rand][0],
gRandomPlayerSpawns[rand][1],
gRandomPlayerSpawns[rand][2]);
}
return 1;
}
La mayorнa de funciones que pusiste no tienen sentido, no explicas ni das informaciуn, ademбs de que pones las que tъ tienes, cosa que no deberнas hacer. Ademбs, el ъltimo callback no lo tendrб.
|
forward SetPlayerRandomSpawn(playerid);
lo que en realidad le falta a ese codigo es el
pawn Код:
ej: cuando cambia de valor el array Spawn[n] xq en diferentes lineas la misma funcion? me refiero a SetPlayerPos(playerid, (salto de linea) codigo, (salto de linea) codigo, (salto de linea) codigo,);? eso da errores. |