Killing Spree 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: Killing Spree Help (
/showthread.php?tid=235853)
Killing Spree Help -
Niko_boy - 06.03.2011
I wanna make a killing spree which always show the Current kiling spree at right bottom of screen ..
Which Show The Name OF Player And His Killing Spree.
eg;;
Player Is On Killing Spree Of 5 Kills in A row.
or if killing changes to 10
then it would be like this
Player Is On Killing Spree Of 10 Kills in A row.
And if killing spree end by another player it should show `Player's Killing Spree is ended by *Player1
` it is the player who is on killing spree
* and this is the player who ended killing spree
I have Made A Try To Make Such Type Of Script But It IS Having A lot Of Errors....
Check The Attachment ..
Please Help !!!
Re: Killing Spree Help -
Stigg - 06.03.2011
This is how i would do it:
Top...
Код:
new KillingSpree[MAX_PLAYERS]
under OnPlayerDeath(playerid, killerid, reason)...
Код:
KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;
if(KillingSpree[killerid] == 5)
{
//do this
}
else if(KillingSpree[killerid] ==10
{
//Do that
}
//And so on..
Re: Killing Spree Help -
Niko_boy - 06.03.2011
Quote:
Originally Posted by Stigg
This is how i would do it:
Top...
Код:
new KillingSpree[MAX_PLAYERS]
under OnPlayerDeath(playerid, killerid, reason)...
Код:
KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;
if(KillingSpree[killerid] == 5)
{
//do this
}
else if(KillingSpree[killerid] ==10
{
//Do that
}
//And so on..
|
Hey But I want To add Text Draw
Re: Killing Spree Help -
OldDirtyBastard - 06.03.2011
Do you have any experiences with strings and textdraws?
Re: Killing Spree Help -
Niko_boy - 06.03.2011
Quote:
Originally Posted by OldDirtyBastard
Do you have any experiences with strings and textdraws?
|
Some I have Created Drift Point And Announcement Text Draws In The Game
Re: Killing Spree Help -
Stigg - 06.03.2011
Try this:
pawn Код:
new KillingSpree[MAX_PLAYERS]
under OnPlayerDeath(playerid, killerid, reason)...
pawn Код:
KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;
if(KillingSpree[killerid] == 5)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(killerid,name,sizeof(name));
new streaktxt[128];
format(streaktxt,sizeof(streaktxt),"~b~NEWS FLASH:~w~ %s is on a Killing Spree. Kills: %d",name,KillingSpree[killerid]);
TextDrawSetString(YOUR_TEXTDRAW,streaktxt);
}
else if(KillingSpree[killerid] == 10)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(killerid,name,sizeof(name));
new streaktxt[128];
format(streaktxt,sizeof(streaktxt),"~b~NEWS FLASH:~w~ %s is on a Killing Spree. Kills: %d",name,KillingSpree[killerid]);
TextDrawSetString(YOUR_TEXTDRAW,streaktxt);
}
And so on...
Re: Killing Spree Help -
Niko_boy - 06.03.2011
Quote:
Originally Posted by Stigg
Try this:
pawn Код:
new KillingSpree[MAX_PLAYERS]
under OnPlayerDeath(playerid, killerid, reason)...
pawn Код:
KillingSpree[killerid] ++; KillingSpree[playerid] = 0; if(KillingSpree[killerid] == 5) { new name[MAX_PLAYER_NAME]; GetPlayerName(killerid,name,sizeof(name)); new streaktxt[128]; format(streaktxt,sizeof(streaktxt),"~b~NEWS FLASH:~w~ %s is on a Killing Spree. Kills: %d",name,KillingSpree[killerid]); TextDrawSetString(YOUR_TEXTDRAW,streaktxt); } else if(KillingSpree[killerid] == 10) { new name[MAX_PLAYER_NAME]; GetPlayerName(killerid,name,sizeof(name)); new streaktxt[128]; format(streaktxt,sizeof(streaktxt),"~b~NEWS FLASH:~w~ %s is on a Killing Spree. Kills: %d",name,KillingSpree[killerid]); TextDrawSetString(YOUR_TEXTDRAW,streaktxt); }
And so on...
|
Getting error
..
newkillingS.pwn(64) : error 035: argument type mismatch (argument 1)
Re: Killing Spree Help -
Stigg - 06.03.2011
And line 64 ?
Re: Killing Spree Help -
omer5198 - 07.03.2011
Quote:
Originally Posted by Stigg
This is how i would do it:
Top...
Код:
new KillingSpree[MAX_PLAYERS]
under OnPlayerDeath(playerid, killerid, reason)...
Код:
KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;
if(KillingSpree[killerid] == 5)
{
//do this
}
else if(KillingSpree[killerid] ==10
{
//Do that
}
//And so on..
|
i never understood something.... can you plz explain to me what the ++ do? i mean... why this line important and what it do?
pawn Код:
KillingSpree[killerid] ++;
Re: Killing Spree Help -
Cameltoe - 07.03.2011
Quote:
Originally Posted by omer5198
i never understood something.... can you plz explain to me what the ++ do? i mean... why this line important and what it do?
pawn Код:
KillingSpree[killerid] ++;
|
pawn Код:
KillingSpree[killerid] ++;
adds 1 to the variable.
pawn Код:
KillingSpree[killerid] += 1;
And
pawn Код:
KillingSpree[killerid] = KillingSpree[killerid] +1;
Would be the same
As:
pawn Код:
KillingSpree[killerid] ++;