06.07.2010, 08:59
I wanted to make something for players with 30 kill streak. Well, I thought it was going to work, so I tried it but nothing happened when I typed /nuke. Then I removed the 30 kill part and suddenly it worked. How can I make it for 30 kills in a row only, I know how to but not without bugs...
Here is my code:
Here is my code:
pawn Код:
public Nuke()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(i,X,Y,Z);
CreateExplosion(X,Y,Z,6,1000000);
CreateExplosion(X,Y,Z,6,1000000);
SetTimer("Nend",5000,0);
SendClientMessageToAll(COLOR_RED,"The nuclear bomb has been exploded!");
return 1;
}
return 1;
}
return 1;
}
pawn Код:
if (PlayerKills[killerid] == 30)
{
SendClientMessage(killerid,COLOR_RED,"You have access to /nuke!");
SendClientMessage(killerid,COLOR_RED,"WARNING: Activating nuke will destroy the whole city!");
format(string, sizeof(string), "%s is on a Killing Spree! [30 kills]", kName);
SendClientMessageToAll(COLOR_UFAC, string);
return 1;
}
}
}
}
return 1;
}
pawn Код:
dcmd_nuke(playerid,params[])
{
#pragma unused params
SetTimer("Nuke",10000,0);
SendClientMessageToAll(COLOR_RED,"Nuclear Bomb has been activated!");
SendClientMessageToAll(COLOR_RED,"The bomb goes off in 10 seconds!");
NC[playerid] = 0;
return 1;
}