Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Willian_Luigi

Pages: [1]
1
Snippet Showroom / Gun game system
« on: October 06, 2013, 03:24:46 am »
[pawn]new gPlayerWeapon [ MAX_PLAYERS ] ,
   gPm [ MAX_PLAYERS ] ,
   gStartGame [ MAX_PLAYERS ] ;

public OnPlayerDeath(playerid, killerid, reason)
{
   if (killerid != INVALID_PLAYER_ID)
   {
      if (gPlayerWeapon [ killerid ] == 10) //Killer progress
      {
         setWinner(killerid);
         return 1;
      }
      gPlayerWeapon [ killerid ] ++ ;
      setWeaponUpgrade(killerid, gPlayerWeapon [ killerid ]);
   }
}

public OnPlayerDeath(playerid, killerid, reason)
{
   gPm [ playerid ] = 1;
}

public OnPlayerSpawn(playerid)
{
   if (gStartGame[playerid])
   {
      setInitDefault(playerid);
      gStartGame[playerid] = 0;
   }
   if (gPm [ playerid ])
   {
      SetPlayerPos(playerid, x, y, z); //x, y, z = hospital position
      gPm [ playerid ] = 0;
   }
}

public OnPlayerConnect(playerid)
{
    gStartGame[playerid] = 1;
}

stock setWinner(pl)
{
   //pl = player who has earned the event.
   //here you put your codes to give money, or greetings messages...
}

stock setInitDefault(pl)
{
   SetPlayerPos(pl, x, y, z); //start position
   setWeaponUpgrade(pl, 0); //call the function to upgrade the player lvl 0.
}

stock setWeaponUpgrade(pl, wp)
{
   switch(wp)
   {
      case 1: GivePlayerWeapon(pl, 22, 9999); // Change the weapons id
      case 2: GivePlayerWeapon(pl, 25, 9999);
      case 3: GivePlayerWeapon(pl, 28, 9999);
      case 4: GivePlayerWeapon(pl, 29, 9999);
      case 5: GivePlayerWeapon(pl, 32, 9999);
      case 6: GivePlayerWeapon(pl, 30, 9999);
      case 7: GivePlayerWeapon(pl, 31, 9999);
      case 8: GivePlayerWeapon(pl, 34, 9999);
      case 9: GivePlayerWeapon(pl, 35, 9999);
      default: GivePlayerWeapon(pl, 4, 1);
   }
}[/pawn]

2
Snippet Showroom / Head Value System
« on: October 05, 2013, 01:47:32 am »
[pawn]new gHeadValue[MAX_PLAYERS];[/pawn]

[pawn]
public OnPlayerSpawn(playerid)
{
   gHeadValue[playerid] = 300; //Set player head value 300
   return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
   if (killerid != INVALID_PLAYER_ID) //Verify if the player has died by another player.
   {
      GivePlayerMoney(killerid, gHeadValue[playerid]); //Give to killer the worth of player head...

      gHeadValue[killerid] += 1000; //Set killer head value = value + 1000
      
      //msgs
      SendClientMessage(killerid, -1, "You have killed +1 noob, so, now your head worth +$1.000");
      SendClientMessage(playerid, -1, "You died, now your head start into the original price($300)");
   }
   return 1;
}[/pawn]


Pages: [1]