#include <a_samp>
//Kills Nesesarios
#define MultiKill 3
#define KillingSpree 5
#define MonsterKill 8
#define LudicrousKill 12
#define HolyShit 20
#define COLOR_GREEN 0xFF0000AA
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Kills Counter By DanielSNM, Modificado por Chiino v2");
print("---(Ideal Para: DM)-------------------\n");
return 1;
}
new kills[MAX_PLAYERS];
new pname[24];
new string[256];
public OnPlayerSpawn(playerid)
{
kills[playerid]=0;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
kills[killerid]++;
if(kills[killerid]==MultiKill) {
GetPlayerName(killerid,pname,24);
format(string,256,">> %s Hizo MultiKill! (+500)",pname);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(killerid,500);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54330022/MultiKill.mp3");
}
}
}
if(kills[killerid]==KillingSpree) {
GetPlayerName(killerid,pname,24);
format(string,256,">> %s KillingSpree! (+1000)",pname);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(killerid,1000);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54330022/KillingSpree.mp3");
}
}
}
if(kills[killerid]==MonsterKill) {
GetPlayerName(killerid,pname,24);
format(string,256,">> %s Hizo M-M-M-MonsterKill! (+1500)",pname);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(killerid,1500);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54330022/Monster%20Kill.mp3");
}
}
}
if(kills[killerid]==LudicrousKill) {
GetPlayerName(killerid,pname,24);
format(string,256,">> %s hizo un L-L-L-LudicrousKill!!! (+2000)",pname);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(killerid,2000);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54330022/Ludicroskill.mp3");
}
}
}
if(kills[killerid]==HolyShit) {
GetPlayerName(killerid,pname,24);
format(string,256,">> %s Mato a 20 personas seguidas. HOLY SHIT!! (+2500)",pname);
SendClientMessageToAll(COLOR_GREEN,string);
format( string, sizeof(string), "~w~%s mato a 20 personas seguidas ~n~~p~holy shit!!", pname );
GameTextForAll( string, 5000, 3 );
GivePlayerMoney(killerid,2500);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54330022/HolyShit.mp3");
}
}
}
return 1;
}
#include <a_samp>
//Kills Nesesarios
#define MultiKill 3
#define KillingSpree 5
#define MonsterKill 8
#define LudicrousKill 12
#define HolyShit 20
#define COLOR_GREEN 0xFF0000AA
new kills[MAX_PLAYERS], pname[MAX_PLAYER_NAME], string[128];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Kills Counter By DanielSNM, Modificado por Chiino v2");
print("---(Ideal Para: DM)-------------------\n");
return 1;
}
public OnPlayerSpawn(playerid)
{
kills[playerid]=0;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
GetPlayerName(killerid, pname, sizeof(pname));
kills[killerid]++;
if(kills[killerid]==MultiKill) {
format(string,sizeof(string), ">> %s Hizo MultiKill %s.", pname);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(killerid,500);
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerConnected(i)){
PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54330022/MultiKill.mp3"); } } }
if(kills[killerid]==KillingSpree) {
format(string,sizeof(string),">> %s KillingSpree! (+1000)",pname);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(killerid,1000);
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerConnected(i)){
PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54330022/KillingSpree.mp3"); } } }
if(kills[killerid]==MonsterKill) {
format(string,sizeof(string),">> %s Hizo M-M-M-MonsterKill! (+1500)",pname);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(killerid,1500);
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerConnected(i)){
PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54330022/Monster%20Kill.mp3");} } }
if(kills[killerid]==LudicrousKill) {
format(string,sizeof(string),">> %s hizo un L-L-L-LudicrousKill!!! (+2000)",pname);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(killerid,2000);
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerConnected(i)){
PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54330022/Ludicroskill.mp3"); } } }
if(kills[killerid]==HolyShit) {
format(string,sizeof(string),">> %s Mato a 20 personas seguidas. HOLY SHIT!! (+2500)",pname);
SendClientMessageToAll(COLOR_GREEN,string);
format(string, sizeof(string), "~w~%s mato a 20 personas seguidas ~n~~p~holy shit!!", pname );
GameTextForAll( string, 5000, 3 );
GivePlayerMoney(killerid,2500);
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerConnected(i)){
PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54330022/HolyShit.mp3"); } } }
return 1;
}
Lo unico que isistes fue borrar los espacios, no es ninguna optimizacion ya que pawno no toma en cuenta los espacios
|
format(string,256, "" ... es mejor format(string,sizeof(string), "", ... (ademas del 256 que es innecesario.)
|
#include <a_samp>
public OnFilterScriptInit()
{
new string[128];
new tick = GetTickCount();
for(new i; i<2000000; i++)
{
format(string,128,"%s","hola");
}
printf("Si format sabe el tamaсo tardo: %d",GetTickCount()-tick);
new tick2 = GetTickCount();
for(new i; i<2000000; i++)
{
format(string,sizeof(string),"%s","hola");
}
printf("Si format no sabe el tamaсo tardo: %d",GetTickCount()-tick2);
print("------------------------------------------------------------");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
Originally Posted by a_samp.inc
pawn Код:
|