SA-MP Forums Archive
Will This SendClientMessageToAll Work? - 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: Will This SendClientMessageToAll Work? (/showthread.php?tid=182537)



Will This SendClientMessageToAll Work? - <Weponz> - 11.10.2010

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??


Re: Will This SendClientMessageToAll Work? - Mike_Peterson - 11.10.2010

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


Re: Will This SendClientMessageToAll Work? - <Weponz> - 11.10.2010

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..


Re: Will This SendClientMessageToAll Work? - Vandooz - 11.10.2010

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.


Re: Will This SendClientMessageToAll Work? - <Weponz> - 11.10.2010

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..


Re: Will This SendClientMessageToAll Work? - Retardedwolf - 11.10.2010

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)