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


Messages In This Thread
Will This SendClientMessageToAll Work? - by <Weponz> - 11.10.2010, 07:10
Re: Will This SendClientMessageToAll Work? - by Mike_Peterson - 11.10.2010, 07:12
Re: Will This SendClientMessageToAll Work? - by <Weponz> - 11.10.2010, 07:19
Re: Will This SendClientMessageToAll Work? - by Vandooz - 11.10.2010, 07:28
Re: Will This SendClientMessageToAll Work? - by <Weponz> - 11.10.2010, 08:39
Re: Will This SendClientMessageToAll Work? - by Retardedwolf - 11.10.2010, 08:42

Forum Jump:


Users browsing this thread: 2 Guest(s)