Hallo,
Es handelt sich um eine DM Arena. Wenn ich innerhalb der Arena gekillt werde, bzw. mich selbst per CMD kille, dann werde ich nicht auf zurück in der Arena gespawnt sondern lande irgendwo in der Luft.
Zudem finde ich seltsam, dass wenn ich gekillt werde, die Sterbeanimation erst nach wenigen Augenblicken eintritt. Liegt das vllt an den gehookten Callbacks?
Falls weitere Codeausschnitte gebraucht werden, sagt bitte bescheid!
Danke!
Haupt Script
public OnPlayerSpawn(playerid)
{
SetPlayerColor(playerid, C_BLUE);
new VirtualWorld = GetPlayerVirtualWorld(playerid);
switch(VirtualWorld)
{
case 0:
{
if(pInfo[playerid][JustLoggedIn] == true)
{
SetCameraBehindPlayer(playerid);
GivePlayerMoneyEx(playerid, pInfo[playerid][Money]);
SetPlayerScore(playerid, pInfo[playerid][Score]);
pInfo[playerid][JustLoggedIn] = false;
return 1;
}
if(pInfo[playerid][JustRegistered] == true)
{
cmd_rules(playerid, "");
pInfo[playerid][JustRegistered] = false;
return 1;
}
if(pInfo[playerid][JustLoggedIn] == false) return GivePlayerMoneyEx(playerid, 5000);
SetSpawnProtection(playerid);
}
}
return 1;
}
Include
public OnPlayerSpawn(playerid)
{
new VirtualWorld = GetPlayerVirtualWorld(playerid);
switch(VirtualWorld)
{
case 1: if(IsPlayerInDM[playerid]) //DM1
{
if(pInfo[playerid][Money] == 0) GivePlayerMoneyEx(playerid, 5000);
new Random = random(sizeof(RandomSpawnsDM1));
UseTeleports[playerid] = false;
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, RandomSpawnsDM1[Random][0], RandomSpawnsDM1[Random][1], RandomSpawnsDM1[Random][2]);
GivePlayerWeapon(playerid, DESERT_EAGLE, 5000);
GivePlayerWeapon(playerid, SHOTGUN, 5000);
GivePlayerWeapon(playerid, SNIPER_RIFLE, 5000);
SetSpawnProtection(playerid);
}
case 2: if(IsPlayerInDM[playerid]) //DM2
{
if(pInfo[playerid][Money] == 0) GivePlayerMoneyEx(playerid, 5000);
new Random = random(sizeof(RandomSpawnsDM2));
UseTeleports[playerid] = false;
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, RandomSpawnsDM2[Random][0], RandomSpawnsDM2[Random][1], RandomSpawnsDM2[Random][2]);
GivePlayerWeapon(playerid, DESERT_EAGLE, 5000);
GivePlayerWeapon(playerid, COMBAT_SHOTGUN, 5000);
GivePlayerWeapon(playerid, COUNTRY_RIFLE, 5000);
SetSpawnProtection(playerid);
}
case 3: if(IsPlayerInDM[playerid]) //DM3
{
if(pInfo[playerid][Money] == 0) GivePlayerMoneyEx(playerid, 5000);
new Random = random(sizeof(RandomSpawnsDM3));
UseTeleports[playerid] = false;
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, RandomSpawnsDM3[Random][0], RandomSpawnsDM3[Random][1], RandomSpawnsDM3[Random][2]);
GivePlayerWeapon(playerid, SAWNOFF_SHOTGUN, 5000);
GivePlayerWeapon(playerid, UZI, 5000);
SetSpawnProtection(playerid);
}
case 4: if(IsPlayerInDM[playerid]) //DM4
{
if(pInfo[playerid][Money] == 0) GivePlayerMoneyEx(playerid, 5000);
new Random = random(sizeof(RandomSpawnsDM4));
UseTeleports[playerid] = false;
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, RandomSpawnsDM4[Random][0], RandomSpawnsDM4[Random][1], RandomSpawnsDM4[Random][2]);
GivePlayerWeapon(playerid, CHAINSAW, 1);
SetSpawnProtection(playerid);
}
case 5: if(IsPlayerInDM[playerid]) //DM5
{
if(pInfo[playerid][Money] == 0) GivePlayerMoneyEx(playerid, 5000);
new Random = random(sizeof(RandomSpawnsDM5));
UseTeleports[playerid] = false;
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, RandomSpawnsDM5[Random][0], RandomSpawnsDM5[Random][1], RandomSpawnsDM5[Random][2]);
GivePlayerWeapon(playerid, MINIGUN, 9999);
SetSpawnProtection(playerid);
}
case 6: if(IsPlayerInDM[playerid]) //Paintball
{
if(pInfo[playerid][Money] == 0) GivePlayerMoneyEx(playerid, 5000);
new Random = random(sizeof(RandomSpawnsPB));
UseTeleports[playerid] = false;
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, RandomSpawnsPB[Random][0], RandomSpawnsPB[Random][1], RandomSpawnsPB[Random][2]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
GivePlayerWeapon(playerid, PISTOL, 9999);
GivePlayerWeapon(playerid, COUNTRY_RIFLE, 9999);
SetSpawnProtection(playerid);
}
case 7: if(IsPlayerInDM[playerid]) //Battlefield
{
if(pInfo[playerid][Money] == 0) GivePlayerMoneyEx(playerid, 5000);
new Random = random(sizeof(RandomSpawnsBF));
UseTeleports[playerid] = false;
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, RandomSpawnsBF[Random][0], RandomSpawnsBF[Random][1], RandomSpawnsBF[Random][2]);
GivePlayerWeapon(playerid, M4, 1000);
GivePlayerWeapon(playerid, UZI, 2000);
GivePlayerWeapon(playerid, GRENADE, 5);
GivePlayerWeapon(playerid, COMBAT_SHOTGUN, 200);
SetSpawnProtection(playerid);
}
}
return DM_OnPlayerSpawn(playerid);
}
forward DM_OnPlayerSpawn(playerid);
#if defined _ALS_OnPlayerSpawn
#undef OnPlayerSpawn
#else
#define _ALS_OnPlayerSpawn
#endif
#define OnPlayerSpawn DM_OnPlayerSpawn