Will This SendClientMessageToAll Work?
#1

Ok i was looking through tutorials and found a "Killing Spree" Tutorial here: https://sampforum.blast.hk/showthread.php?tid=155885

I want it to announce every successfull Killing Spree,His code looks like this:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
 KillingSpree[killerid] ++; // Means that the killer will get 1 kills
 KillingSpree[playerid] = 0; // Means that the player who died his killing spree will be restored to 0.

 if(KillingSpree[killerid] == 3) // It finds if the player is on a Killing Spree of 3 kills , you may change
 {
  // If you want to give the player that has 3 killing spree a reward do something here 
 }
 return 1;
}
So If I Just Add String:

Код:
        GetPlayerName(playerid,pname,24);
        format(string,sizeof(string), "*** %s Is On A Killing Spree!",pname);
        SendClientMessageToAll(RED,string);
So It Looks Like This:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
 KillingSpree[killerid] ++; // Means that the killer will get 1 kills
 KillingSpree[playerid] = 0; // Means that the player who died his killing spree will be restored to 0.

 if(KillingSpree[killerid] == 3) // It finds if the player is on a Killing Spree of 3 kills , you may change
 {
          GetPlayerName(playerid,pname,24);
        format(string,sizeof(string), "*** %s Is On A Killing Spree!",pname);
        SendClientMessageToAll(RED,string);
 }
 return 1;
}
Will It Work??
Reply
#2

with
Код:
new pname[MAX_PLAYER_NAME];
why not? dude try and compile and test urself XD
Reply
#3

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
with
Код:
new pname[MAX_PLAYER_NAME];
why not? dude try and compile and test urself XD
Yeh theres "new KillingSpree[MAX_PLAYERS];" i just didnt put it,And this is how i learn to script,I find out wat i need,See how its done,Then use the knowlage to create my code and i use SAMP forum Scripting Disscussion Section to get the answers i need to open my eyes more,Isnt that what its for??

And i just learnt how this string works completely by your answer and now alot of things make sence soo..
Reply
#4

Quote:
Originally Posted by <Weponz>
Посмотреть сообщение
Yeh theres "new KillingSpree[MAX_PLAYERS];" i just didnt put it,And this is how i learn to script,I find out wat i need,See how its done,Then use the knowlage to create my code and i use SAMP forum Scripting Disscussion Section to get the answers i need to open my eyes more,Isnt that what its for??
1. Only people with a REAL problem can post here, Mike is completely right.
2. USE the WIKI, that wiki is there to LEARN PAWNo to you.
Reply
#5

Quote:
Originally Posted by Vandooz
Посмотреть сообщение
1. Only people with a REAL problem can post here, Mike is completely right.
2. USE the WIKI, that wiki is there to LEARN PAWNo to you.
WRONG...Try Getting Your Facts Right Mate,Try Reading The Details Of "Scripting Disscussion" It Says This "Discussion and help related to creating scripts for SA-MP."...So Stop Abusing People For No Reason..

So I Have 2 Words For You Sir,

Good Day!

OFF TOPIC: This Is About As Epic As It Gets..
Reply
#6

pawn Код:
new pname[24];
new string[32];
the KillingSpree[MAX_PLAYERS] was a number to store the player's killing spree. (I used 'number' to make it easier for him)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)