Hey,
brauche Hilfe bei einem Script. Das Problem am Script ist, dass immer wenn man spawnt, man als erstes tot spawnt und dann nochmal wieder normal spawnt.Hoffe ihr versteht was ich meine.
if (strcmp("/dm", cmdtext, true) == 0)
{
if(dmon[playerid] == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 28, 500);
dmon[playerid] = 1;
SetPlayerDmSpawn(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "Du hast dich zum Deathmatch geportet ! Um das Deathmatch wieder zu verlassen /exit.");
SetPlayerColor(playerid, 0);
}
else
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 28, 500);
dmon[playerid] = 1;
SetPlayerDmSpawn(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "Du hast dich zum Deathmatch geportet ! Um das Deathmatch wieder zu verlassen /exit.");
SetPlayerColor(playerid, 0);
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du bist schon im Deathmatch!");
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new playercash;
if(dmon[playerid] == 1)
{
SetPlayerDmSpawn(playerid);
}
else if(killerid == INVALID_PLAYER_ID)
{
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
ResetPlayerMoney(playerid);
}
else
{
SendDeathMessage(killerid,playerid,reason);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
playercash = GetPlayerMoney(playerid);
if (playercash > 0)
{
GivePlayerMoney(killerid, playercash);
ResetPlayerMoney(playerid);
}
}
return 1;
}
Hoffe ihr könnt mir weiterhelfen.