new spree[MAX_PLAYERS];
new Text:Spree;
forward Txtreset();
public Txtreset()
{
TextDrawHideForAll(Spree);
return 1;
}
public OnGameModeInit()
{
Spree = TextDrawCreate(9.000000,310.000000,"%s is on a killing spree of i kills.");
TextDrawAlignment(Spree,0);
TextDrawBackgroundColor(Spree,0x000000ff);
TextDrawFont(Spree,3);
TextDrawLetterSize(Spree,0.299999,0.799999);
TextDrawColor(Spree,0xffffffff);
TextDrawSetOutline(Spree,1);
TextDrawSetProportional(Spree,1);
TextDrawSetShadow(Spree,1);
TextDrawHideForAll(Spree);
return 1;
}
public OnGameModeExit()
{
TextDrawDestroy(Spree);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
spree[killerid]++;
if(spree[killerid] == 2) {
new string[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(killerid, pName, sizeof(pName));
format(string, sizeof(string), "%s is on a killing spree, with 5 kills", pName); //It goes for 2 kills
TextDrawHideForAll(Spree);
TextDrawSetString(Spree, string);
TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
}
if(spree[killerid] == 7) {
new string[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(killerid, pName, sizeof(pName));
format(string, sizeof(string), "%s is on a killing spree, with 7 kills!", pName);//it goes for 7 kills!
TextDrawHideForAll(Spree);
TextDrawSetString(Spree, string);
TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
//Here you can add a function or a special action with 7 kills
}
if(spree[killerid] == 10) {
new string[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(killerid, pName, sizeof(pName));
format(string, sizeof(string), "%s is on a killing spre with 10 kills~", pName);//It goes for 10 kills
TextDrawHideForAll(Spree);
TextDrawSetString(Spree, string);
TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);//You can add more if you want!
}
return 1;
}
Spree = TextDrawCreate(9.000000,310.000000,"s is on a killing spree of i kills.");
%s
See you wrong here
pawn Код:
pawn Код:
|
if(spree[killerid] == 2) { new string[128]; new pName[MAX_PLAYER_NAME]; GetPlayerName(killerid, pName, sizeof(pName)); format(string, sizeof(string), "%s is on a killing spree, with 5 kills", pName); //It goes for 2 kills TextDrawHideForAll(Spree); TextDrawSetString(Spree, string); TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0); |