open.mp forum
[Pawn] Help with kill streack - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Help with kill streack (/showthread.php?tid=1335)



Help with kill streack - DaZzY - 2020-11-11

Hello?

i have kill streack on my server and i want to show a message who end a kill streack of someone?

example ( player1?ended streack of players 2 )



Quote:public OnPlayerDeath(playerid,killerid,reason)

{

new str[128];

new name[32];

GetPlayerName(killerid,name,32);





killstreak[killerid];

killstreak[playerid] = 0;





switch(killstreak[killerid])

{



case 3:

{



format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Killing Spree"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 5:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Dominating!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 6:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"UnStoppable!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 7:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Wicked Sick!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 8:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Monster like!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 9:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"GOD LIKE!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 10:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Immortal!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

SetPlayerArmour(killerid,100);

}

}

return 1;

}



RE: Help with kill streack - DaZzY - 2020-11-11

Any one please :===)


RE: Help with kill streack - Expert* - 2020-11-12

PHP Code:
public OnPlayerDeath(playerid,killerid,reason)
{
new 
str[128];
new 
name[32];
GetPlayerName(killerid,name,32);


if( 
killstreak[playerid] >= && killerid != INVALID_PLAYER_ID )
{
new 
pname[24];
GetPlayerName(playeridpname);
format(str,sizeof(str) - 1,""RED"[DM] You have ended %s killstreak of %i kills..."pnamekillstreak[playerid]);
SendClientMessage(-1killeridstr);
}


killstreak[killerid];
killstreak[playerid] = 0;


switch(
killstreak[killerid])
{

case 
3:
{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Killing Spree"GREY"!!",name);
SendClientMessageToAll(-1,str);
}
case 
5:
{
format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Dominating!!"GREY"!!",name);
SendClientMessageToAll(-1,str);
}
case 
6:
{
format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"UnStoppable!!"GREY"!!",name);
SendClientMessageToAll(-1,str);
}
case 
7:
{
format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Wicked Sick!!"GREY"!!",name);
SendClientMessageToAll(-1,str);
}
case 
8:
{
format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Monster like!!"GREY"!!",name);
SendClientMessageToAll(-1,str);
}
case 
9:
{
format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"GOD LIKE!!"GREY"!!",name);
SendClientMessageToAll(-1,str);
}
case 
10:
{
format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Immortal!!"GREY"!!",name);
SendClientMessageToAll(-1,str);
SetPlayerArmour(killerid,100);
}
}
return 
1;




RE: Help with kill streack - Pinch - 2020-11-12

(2020-11-12, 08:11 PM)Expert* Wrote:
PHP Code:
public OnPlayerDeath(playerid,killerid,reason)

{

new 
str[128];

new 
name[32];

GetPlayerName(killerid,name,32);





if( 
killstreak[playerid] >= && killerid != INVALID_PLAYER_ID )

{

new 
pname[24];

GetPlayerName(playeridpname);

format(str,sizeof(str) - 1,""RED"[DM] You have ended %s killstreak of %i kills..."pnamekillstreak[playerid]);

SendClientMessage(-1killeridstr);

}





killstreak[killerid];

killstreak[playerid] = 0;





switch(
killstreak[killerid])

{



case 
3:

{



format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Killing Spree"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 
5:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Dominating!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 
6:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"UnStoppable!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 
7:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Wicked Sick!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 
8:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Monster like!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 
9:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"GOD LIKE!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

}

case 
10:

{

format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Immortal!!"GREY"!!",name);

SendClientMessageToAll(-1,str);

SetPlayerArmour(killerid,100);

}

}

return 
1;





Just create an { streak ,"message" } array as this one is inefficient af


RE: Help with kill streack - DaZzY - 2020-11-12

Okey thank you :)