hallo habe ein problem mit meinem obplayerdeath wenn ich mich nun selbst kille kommt der spectator der müsste eigtl. aber nicht kommen was könnte ich vrbessern K & K2 sind DM-welten und wenn ich in einer dm welt bin jmd. töte bekomme ich 2000$ sollte aber 1000$ sein
public OnPlayerDeath(playerid, killerid, reason)
{
GivePlayerMoney(killerid, 1000);
GivePlayerMoney(playerid, -200);
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);
SetTimerEx("Spectator", 12000, false, "i", playerid);
TextDrawHideForPlayer(playerid,(TextCp)); TextDrawHideForPlayer(playerid,(TextGa)); TextDrawHideForPlayer(playerid,(Textdraw2));TextDrawHideForPlayer(playerid,(Textdraw3));
new vehicleid = GetPlayerVehicleID(playerid);
new playerstate = GetPlayerState(playerid);
if(playerstate == PLAYER_STATE_DRIVER)
{
Lock[vehicleid] = 0;
}
SendDeathMessage(killerid,playerid,reason);
ResetPlayerWeapons(playerid);
kills[killerid]++;
tode[playerid]++;
if(k[killerid] == true)
{
Score[killerid] += 1;
if(Score[killerid] > TopScore)
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);
SetTimerEx("Spectator", 10000, false, "i", playerid);
for(new i=0; i<MAX_PLAYERS;i++)
{
if(k[killerid] == true)
{
SendClientMessage(i,0xD7FF00FF,TopPerson);
}
}
}
}
if(k2[killerid] == true)
{
Score2[killerid] += 1;
if(Score2[killerid] > TopScore2)
{
GivePlayerMoney(killerid, 1000);
GivePlayerMoney(playerid, -200);
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);
SetTimerEx("Spectator", 8000, false, "i", playerid);
for(new i=0; i<MAX_PLAYERS;i++)
{
if(k2[killerid] == true)
{
SendClientMessage(i,0xD7FF00FF,TopPerson2);
}
}
}
}
if(gTeam[playerid]==TEAM_Cops)
{
//if(k[killerid] == false && k2[killerid] == false)
{
GivePlayerMoney(killerid, 1000);
GivePlayerMoney(playerid, -200);
Scop++;
Score[killerid] += 1;
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);
SetTimerEx("Spectator", 12000, false, "i", playerid);
}
}
if(gTeam[playerid]==TEAM_Gangsta)
{
//if(k[killerid] == false && k2[killerid] == false)
{
GivePlayerMoney(killerid, 1000);
GivePlayerMoney(playerid, -200);
Sgangsta ++;
Score[killerid] += 1;
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);
SetTimerEx("Spectator", 12000, false, "i", playerid);
}
}
new string1[5], string[5];
valstr(string, Scop);
TextDrawSetString(TextCp, string);
valstr(string1, Sgangsta);
TextDrawSetString(TextGa, string1);
if(killerid == INVALID_PLAYER_ID)
{
}
if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
TogglePlayerControllable(playerid,false);
new KMessage[100];
GetPlayerName(killerid, KMessage, sizeof(KMessage));
format(KMessage, sizeof(KMessage), " %s wurde vom System gekickt DriveBy", KMessage);
SendClientMessageToAll(0xFF6347AA, KMessage);
Kick(killerid);
}
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
return 1;
}