/airstrike help. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /airstrike help. (
/showthread.php?tid=186023)
/airstrike help -
Haydz - 27.10.2010
Alright, so i'v made this /airstrike command and need it to be available when a player reaches a kill streak of 5 and they can only use it once.
my code, i'v got the explosion done and it works nicely, now i just need to make it so a player can only use it once, and once they get a +5 kill streak.
If possible could you add a //and what the lines do so i can learn/remember this for later, thank you.
Код:
if (strcmp("/airstrike", cmdtext, true, 5) == 0)
{
new Float:x, Float:y, Float:z ;
GetPlayerPos( playerid, Float:x, Float:y, Float:z );
CreateExplosion(Float:x+10, Float:y, Float:z, 8,10.0);
CreateExplosion(Float:x-10, Float:y, Float:z, 8,10.0);
CreateExplosion(Float:x, Float:y+10, Float:z, 8,10.0);
CreateExplosion(Float:x, Float:y-10, Float:z, 8,10.0);
CreateExplosion(Float:x+10, Float:y+10, Float:z, 8,10.0);
CreateExplosion(Float:x-10, Float:y+10, Float:z, 8,10.0);
return CreateExplosion(Float:x-10, Float:y-10, Float:z, 8,10.0);
}
Re: /airstrike help. -
Haydz - 27.10.2010
sorry for double post
Don't worry about isplayerinrangeofpoint, i'v fixed it.
Re: /airstrike help. -
Bessensap - 27.10.2010
I'm not going to make the whole code for you, but i'm going to help u out with a few keywords
pawn Код:
new PlayerKillStreak[MAX_PLAYERS]
//////////////
OnPlayerDeath()
PlayerKillStreak[killerid]++
PlayerKillStreak[deadid] = 0;
//////////////////////
OnPlayerCommandText(blabla)
if (strcmp("/airstrike", cmdtext, true, 5) == 0)
{
if(PlayerKillStreak[playerid] < 5) return SendClientMessage(playerid,COLOR_....,"Your killstreak is too low!");
PlayerKillStreak[playerid]-5;
new Float:x, Float:y, Float:z ;
GetPlayerPos( playerid, Float:x, Float:y, Float:z );
CreateExplosion(Float:x+10, Float:y, Float:z, 8,10.0);
CreateExplosion(Float:x-10, Float:y, Float:z, 8,10.0);
CreateExplosion(Float:x, Float:y+10, Float:z, 8,10.0);
CreateExplosion(Float:x, Float:y-10, Float:z, 8,10.0);
CreateExplosion(Float:x+10, Float:y+10, Float:z, 8,10.0);
CreateExplosion(Float:x-10, Float:y+10, Float:z, 8,10.0);
return CreateExplosion(Float:x-10, Float:y-10, Float:z, 8,10.0);
}
Re: /airstrike help. -
Haydz - 27.10.2010
Quote:
Originally Posted by Bessensap
I'm not going to make the whole code for you, but i'm going to help u out with a few keywords
pawn Код:
new PlayerKillStreak[MAX_PLAYERS] ////////////// OnPlayerDeath() PlayerKillStreak[killerid]++ PlayerKillStreak[deadid] = 0; //////////////////////
OnPlayerCommandText(blabla) if (strcmp("/airstrike", cmdtext, true, 5) == 0) { if(PlayerKillStreak[playerid] < 5) return SendClientMessage(playerid,COLOR_....,"Your killstreak is too low!"); PlayerKillStreak[playerid]-5; new Float:x, Float:y, Float:z ; GetPlayerPos( playerid, Float:x, Float:y, Float:z ); CreateExplosion(Float:x+10, Float:y, Float:z, 8,10.0); CreateExplosion(Float:x-10, Float:y, Float:z, 8,10.0); CreateExplosion(Float:x, Float:y+10, Float:z, 8,10.0); CreateExplosion(Float:x, Float:y-10, Float:z, 8,10.0); CreateExplosion(Float:x+10, Float:y+10, Float:z, 8,10.0); CreateExplosion(Float:x-10, Float:y+10, Float:z, 8,10.0); return CreateExplosion(Float:x-10, Float:y-10, Float:z, 8,10.0);
}
|
Cheers, worked nicely thanks.
Re: /airstrike help. -
Bessensap - 27.10.2010
No prob