Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: aledark24 on May 02, 2013, 08:31:24 pm

Title: Easy Spree System
Post by: aledark24 on May 02, 2013, 08:31:24 pm
[pawn]new INFO[256];[/pawn]


[pawn]public OnPlayerDeath(playerid, killerid, reason)
{
   if ( killerid == INVALID_PLAYER_ID )
   {
      new string[ 128 ], reasonText[ 16 ];
      switch( reason )
      {
         case 43: reasonText = "drowned";
         case 255: reasonText = "suicide";
      }
      format( string, 128, "** %s is death reason [%s]", gPlayers[ playerid ], reasonText );
      print( string );
            new szMsg[256];
      format( szMsg, sizeof( szMsg ),"[%s] is death reason [%s]",gPlayers[ playerid ], reasonText );
      SendClientMessageToAll(AMARILLO, szMsg );// CHANGE FOR YOUR COLOUR
      if ( GetPlayerMoney(playerid) > 199 ) MenosDinero(playerid,200);//change for you decplayerhandcash
      QuitaSpree(playerid);
}
    if (ObtenerSpree(killerid) == 4)
{
MasDinero(killerid,1500);// change for you incplayerhandcash
GameTextForPlayer(killerid,"~a~SPREE 5 Kills!!");
}
    if (ObtenerSpree(killerid) == 9)
{
MasDinero(killerid,2000);// change for you incplayerhandcash
GameTextForPlayer(killerid,"~a~SPREE 10 Kills!!");
}
    if (ObtenerSpree(killerid) == 14)
{
MasDinero(killerid,2500);// change for you incplayerhandcash
GameTextForPlayer(killerid,"~a~SPREE 15 Kills!!");
}
    if (ObtenerSpree(killerid) == 19)
{
MasDinero(killerid,3500);// change for you incplayerhandcash
GameTextForPlayer(killerid,"~a~SPREE 20 Kills!!");
}
    if (ObtenerSpree(killerid) == 24)
{
MasDinero(killerid,4500);// change for you incplayerhandcash
GameTextForPlayer(killerid,"~a~SPREE 25 Kills!!");
}
    MasDinero(killerid,300);// change for you incplayerhandcash
    SetPlayerHealth(killerid,100.0);
    SetWantedLevel(killerid,6);
    DarSpree(killerid,1);
    QuitaSpree(playerid);
    if ( GetPlayerMoney(playerid) > 199 ) MenosDinero(playerid,200); //change for you decplayerhandcash

    return 1;
}[/pawn]


Publics
[pawn]//==============================================================================
public ObtenerSpree(playerid)
{
    format(INFO,256, REGISTROS, gPlayers[playerid]);//change for you name of registers folders
   new spree; spree = dini_Int(INFO,"Spree");
   return spree;
}
public DarSpree( playerid, Amount )
{
   format( file, sizeof( file ), REGISTROS, gPlayers[ playerid ] );//change for you name of registers folders
   new asesinados; asesinados = dini_Int( file, "Spree" );
   dini_IntSet( file, "Spree", asesinados +Amount);
}
//==============================================================================

public QuitaSpree(playerid)
{
    format(INFO,256, REGISTROS, gPlayers[playerid]);//change for you name of registers folders
   dini_Unset(INFO,"Spree");
}
//==============================================================================[/pawn]

Title: Re: Easy Spree System
Post by: sseebbyy on May 02, 2013, 09:32:14 pm
First look: You used too many "if" . Try to use "switch".
Title: Re: Easy Spree System
Post by: aledark24 on May 02, 2013, 09:40:13 pm
First look: You used too many "if" . Try to use "switch".

but working well....
whit not bugs..
Title: Re: Easy Spree System
Post by: MatheuS on May 02, 2013, 09:41:40 pm
aledark you did this system spree more thing, This system will only function normally on the server that you created not the other type, REGISTROS, MasDinero, MenosDinero...
Title: Re: Easy Spree System
Post by: aledark24 on May 02, 2013, 09:43:41 pm
aledark you did this system spree more thing, This system will only function normally on the server that you created not the other type, REGISTROS, MasDinero, MenosDinero...


read....
[pawn]
//change for you name of register folder...
//change for you incplayerhandcash
//change for you decplayerhandcash
// CHANGE FOR YOUR COLOUR
// if you are scripter... you understand, and change for you warchief...
[/pawn]

Title: Re: Easy Spree System
Post by: MatheuS on May 02, 2013, 09:45:32 pm
aledark you did this system spree more thing, This system will only function normally on the server that you created not the other type, REGISTROS, MasDinero, MenosDinero...


read....
[pawn]
//change for you name of register folder...
//change for you incplayerhandcash
//change for you decplayerhandcash
// if you are scripter... you understand, and change for you warchief...
[/pawn]

[pawn]Amarillo to YELLOW...[/pawn]
Title: Re: Easy Spree System
Post by: sseebbyy on May 02, 2013, 09:51:47 pm
First look: You used too many "if" . Try to use "switch".

but working well....
whit not bugs..

It can make lag on server.
Title: Re: Easy Spree System
Post by: aledark24 on May 02, 2013, 10:03:30 pm
First look: You used too many "if" . Try to use "switch".

but working well....
whit not bugs..

It can make lag on server.
whatever i not understand yet the switch xD
Title: Re: Easy Spree System
Post by: dynavolt71 on May 03, 2013, 09:01:06 am
Lol
Try find switch in gups and learn about it xD
Title: Re: Easy Spree System
Post by: Tomiijaja on May 12, 2013, 06:58:32 pm
LoL spree with dini_set.. nice ._.
Title: Re: Easy Spree System
Post by: MatheuS on May 12, 2013, 08:29:16 pm
LoL spree with dini_set.. nice ._.
loool
Title: Re: Easy Spree System
Post by: dynavolt71 on May 13, 2013, 10:15:58 am
Does "Dini_set" will auto create if file not exist ?