Killstreak bugged - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Killstreak bugged (
/showthread.php?tid=354399)
Killstreak bugged -
Swyft™ - 26.06.2012
My killstreak system is bugged after I added my 2nd deathmatch in my server, this is the thing
OnPlayerDeath
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new pName[MAX_PLAYER_NAME];
SetPlayerHealth(playerid, 0);
new string[128];
GetPlayerName(playerid, pName, sizeof(pName));
SendDeathMessage(killerid, playerid, reason);
Anticheat(playerid, killerid);
if(DMZone[playerid] == 0)
{
DMZone[playerid] = 0;
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, -2489.8352,-616.3492,132.5658);
}
if(DMZone[playerid] == 1)
{
return cmd_ffa(playerid);
}
if(DMZone[playerid] == 2)
{
return cmd_shopdm(playerid);
}
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
{
if(GetPlayerWantedLevel(killerid) < 6)
{
SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
}
KillStreak[killerid]++;
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
SetPlayerWantedLevel(playerid,0);
KillStreak[playerid] = 0;
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(killerid, PlayerName, sizeof(PlayerName));
switch( KillStreak[ killerid ] )
{
case 0:
{
if(DMZone[killerid] >= 1)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
}
case 1:
{
if(DMZone[killerid] >= 1)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
}
case 2:
{
if(DMZone[killerid] >= 1)
{
format(string, sizeof(string), "[KILL]{FFFFFF} %s has a killstreak of three! (Reward: Free Health)", PlayerName);
SetPlayerHealth(killerid, 100);
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
}
case 3:
{
if(DMZone[killerid] >= 1)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
}
case 4:
{
if(DMZone[killerid] >= 1)
{
format(string, sizeof(string), "[KILL]{FFFFFF} %s has a killstreak of five!", PlayerName);
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
}
case 5:
{
if(DMZone[killerid] >= 1)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
}
case 6:
{
if(DMZone[killerid] >= 1)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
}
case 7:
{
if(DMZone[killerid] >= 1)
{
format(string, sizeof(string), "[KILL]{FFFFFF} %s has a killstreak of eight! (Reward: 5000 Dollars)", PlayerName);
GivePlayerMoney(killerid, 5000);
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
}
case 8:
{
if(DMZone[killerid] >= 1)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
}
case 9:
{
if(DMZone[killerid] >= 1)
{
format(string, sizeof(string), "[KILL]{FFFFFF} %s has a killstreak of ten! (Reward: 20,000 Dollars)", PlayerName);
GivePlayerMoney(killerid, 25000);
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 5);
}
}
}
return 1;
}
FFA - DM 1
pawn Код:
CMD:ffa(playerid)
{
DMZone[playerid] = 1;
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 31, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 32, 250);
SetPlayerPos(playerid, 213.7691, 1867.6930, 13.1406);
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_BASIC,"You have teleported to [/FFA]");
SendClientMessage(playerid, COLOR_BASIC,"Cheating in [/FFA] will result in Ban!");
SetPlayerWorldBounds(playerid, 396.44, 83.08, 2097.88, 1749.28);
SetPlayerInterior(playerid, 0);
return 1;
}
SHOPDM - DM 2
pawn Код:
CMD:shopdm(playerid)
{
DMZone[playerid] = 2;
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 31, 500);
GivePlayerWeapon(playerid, 30, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 32, 500);
GivePlayerWeapon(playerid, 37, 75);
SetPlayerPos(playerid, -30.946699,-89.609596,1003.546875);
SetPlayerInterior(playerid, 18);
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_BASIC,"You have teleported to [/shopdm]");
SendClientMessage(playerid, COLOR_BASIC,"Cheating in [/shopdm] will result in Ban!");
return 1;
}
Re: Killstreak bugged -
[KHK]Khalid - 26.06.2012
Well, and the problem is the killstreaks part isn't working when players in dms ha?
try changing
pawn Код:
return cmd_ffa(playerid);
to
and this
pawn Код:
return cmd_shopdm(playerid);
to