20.11.2010, 20:19
How do i make this, Make this command for only a person with a 5 killstreak?
new pKills[MAX_PLAYERS];
public OnPlayerDeath(...)
{
pKills[killerid]++;
if(pKills[killerid] == 5)
{
SendClientMessage(killerid, COLOR, "You now have 5 kills!");
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason) // You count kills here.
{
SetPVarInt(killerid,"KillStreak",GetPVarInt(killerid,"KillStreak") + 1);
SetPVarInt(playerid,"KillStreak",0);
return 1;
}
// And when you make a command, you add this check before it can be used:
if(GetPVarInt(playerid,"KillStreak") >= 5)
How do i make this, Make this command for only a person with a 5 killstreak?
|
new pKills[MAX_PLAYERS];
pKills[playerid] = 0;
pKills[killerid]++; //Add one kill to the one who killed.
pKills[playerid] = 0; //When someone dies, reset their kills.
if(strcmp(cmdtext, "/command", true)==0)
{
if(pKills[playerid] => 5)
{
//Code here
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "You need to have a killstreak of 5 kills or more to use this command.");
}
return 1;
}