[Ajuda] Spawn em diferentes lugares
#1

Pessoal , eu somente queria ajuda , por que eu queria spawnar o player em diferentes lugares , por exenplo

ao logar - lugar 1
moreu - lugar 2
moreu dnv - lugar 3 assim
meu gm ta do 0

Quote:

#include <a_samp>


public OnGameModeInit()
{
AddPlayerClass(0,1958.3783,1343.1572,15.3746,269.1 425,0,0,0,0,0,0); //
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

eu tentei :
Quote:

public OnGameModeInit()
{
AddPlayerClass(0,1958.3783,1343.1572,15.3746,269.1 425,0,0,0,0,0,0); //
AddPlayerClass(0,1958.3783,1343.1572,15.3746,269.1 425,0,0,0,0,0,0); //
AddPlayerClass(0,2279.9985,-615.3870,134.5559,228.3854,0,0,0,0,0,0); // 1
AddPlayerClass(0,2279.9985,-615.3870,134.5559,228.3854,0,0,0,0,0,0); // 1
AddPlayerClass(0,2553.1404,-952.1654,82.6709,106.1843,0,0,0,0,0,0); // 2
AddPlayerClass(0,2432.2146,-2423.9443,13.6276,230.5788,0,0,0,0,0,0); // 3
AddPlayerClass(0,1477.2146,-2027.1406,31.9044,230.5788,0,0,0,0,0,0); // 4
AddPlayerClass(0,698.2166,-1461.7200,8.9766,8.7601,0,0,0,0,0,0); // 5
AddPlayerClass(0,-15.4324,-2503.9709,36.6555,102.1343,0,0,0,0,0,0); // 5
AddPlayerClass(0,-32.4647,-1149.8997,1.7430,102.7609,0,0,0,0,0,0); // 6
AddPlayerClass(0,-2203.6240,-2387.5686,30.8311,237.1823,0,0,0,0,0,0); // 7
AddPlayerClass(0,-2095.1865,-2256.5686,36.1356,237.1823,0,0,0,0,0,0); // 8
AddPlayerClass(0,-2098.9272,-2261.9961,30.6250,138.7222,0,0,0,0,0,0); // 8
AddPlayerClass(0,-2302.7112,-1630.5436,483.7253,211.4162,0,0,0,0,0,0); // 9
AddPlayerClass(0,-2499.9785,-612.6174,132.5625,262.4666,0,0,0,0,0,0); // 10
AddPlayerClass(0,-2122.1563,269.3272,35.6318,262.4666,0,0,0,0,0,0); // 11
AddPlayerClass(0,-2474.0337,2520.6338,17.7863,279.4102,0,0,0,0,0,0); // 12
AddPlayerClass(0,-1532.3290,2626.8054,55.8359,3.0710,0,0,0,0,0,0); // 13
AddPlayerClass(0,-544.0884,2591.6729,53.5156,280.3736,0,0,0,0,0,0); // 14
AddPlayerClass(0,-174.0884,2676.4385,62.6836,280.3736,0,0,0,0,0,0); // 15
AddPlayerClass(0,439.9116,2438.3594,17.5663,280.37 35,0,0,0,0,0,0); // 16
AddPlayerClass(0,1290.6293,1653.7976,10.8203,38.16 46,0,0,0,0,0,0); // 17
AddPlayerClass(0,1757.8960,2766.7656,10.8359,200.4 943,0,0,0,0,0,0); // 18
return 1;
}

mais assim fica dando respawn onde ele escolheu
pf ajudem !
Reply
#2

Exemplo :

Код:
public OnPlayerSpawn(playerid)
{
    SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
    return 1;
}
https://sampwiki.blast.hk/wiki/SetSpawnInfo

https://sampwiki.blast.hk/wiki/OnPlayerSpawn

Pode usar um random .
Reply
#3

https://sampwiki.blast.hk/wiki/Random < A Wiki jб vem com exemplos do que se pede.
Reply
#4

Topo do GM

PHP код:
new Float:SpawnDiferente[5][3] =
{
    {
1807.0757,-1690.0712,13.5457},
    {
1379.6189,-1659.0195,13.5457},
     {
1409.3663,-1306.9072,9.2937},
    {
1340.3314,-1775.7716,13.5114},
       {
2426.0017,-1230.0343,24.9293}
}; 
em
PHP код:
OnPlayerSpawn 
PHP код:
new rand random(sizeof(SpawnDiferente));
SetPlayerPos(playeridSpawnDiferente[rand][0], SpawnDiferente[rand][1], SpawnDiferente[rand][2]); 
Reply
#5

Vlws mesmo ! Com a resposta de voceis , basei esse codigo que ta funcionando de boa !! vlws !

Quote:

new Float:RandomSpawns[][] =
{

{1958.3783, 1343.1572, 15.3746, 269.1425},
{2279.9985, -615.3870, 134.5559, 228.3854},
{2279.9985, -615.3870, 134.5559, 228.3854},
{2553.1404, -952.1654, 82.6709, 106.1843},
{2432.2146, -2423.9443, 13.6276, 230.5788},
{1477.2146, -2027.1406, 31.9044, 230.5788},
{698.2166, -1461.7200, 8.9766, 8.7601},
{-15.4324, -2503.9709, 36.6555, 102.1343},
{-32.4647, -1149.8997, 1.7430, 102.7609},
{-2203.6240 ,-2387.5686, 30.8311, 237.1823},
{-2095.1865 ,-2256.5686, 36.1356, 237.1823},
{-2098.9272 ,-2261.9961, 30.6250, 138.7222},
{-2302.7112 ,-1630.5436, 483.7253, 211.4162},
{-2499.9785 ,-612.6174, 132.5625, 262.4666},
{-2122.1563 ,269.3272, 35.6318, 262.4666},
{-2474.0337 ,2520.6338, 17.7863, 279.4102},
{-1532.3290, 2626.8054, 55.8359, 3.071,0},
{-544.0884, 2591.6729, 53.5156, 280.3736},
{-174.0884, 2676.4385, 62.6836, 280.3736},
{1290.6293, 1653.7976, 10.8203, 38.1646},
{1757.8960, 2766.7656, 10.8359, 200.4943}

};

em public OnPlayerRequestClass(playerid, classid)
Quote:

{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

em
public OnPlayerSpawn(playerid)
Quote:

{
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
return 1;
}

Era So algumas duvidas ! valeu ai
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)