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.


Topics - JackDawZ

Pages: [1]
1
Snippet Showroom / Healing in 5 secs :D
« on: November 11, 2012, 11:53:35 pm »
Moderator note: This code does not work with players who have an ID other than 0.
See post: http://forum.vicecitymultiplayer.com/index.php?topic=5276.msg32006#msg32006


Hello guys, and i want to share with you by my little script "Healing in 5 secs" xD
It's very easy:

Command:
[pawn]}
   else if ( strcmp( cmd, "!heal", true ) == 0 )
   {
      new Float:Health; GetPlayerHealth( playerid, Health );
        if ( Health >= 100 ) SendClientMessage( playerid, COLOR_YELLOW, ">> Error: You are healthy." );
      else
      {
          TogglePlayerControllable(playerid,0);
         SetTimer("Healing",5000,0);
          GameTextForPlayer(playerid, "Healing");
      }
      return 1;
      }
   return 1;
}[/pawn]

Timer:
[pawn]}
public Healing(playerid)
{
TogglePlayerControllable(playerid, 1);
SetPlayerHealth( playerid, 100.0 );
SendClientMessage( playerid, COLOR_YELLOW, ">> You have been healed!" );
}[/pawn]

Have fun! ;)

2
Tutorials / How to use OnPickedUp.
« on: October 24, 2012, 12:14:41 pm »
if you want to make the pickup with many functions, read my article.

For a beginning:
Quote
#define JACK_WHITE 0xFFFFFFAA // Copypast to your pwn file

1st Step. To add pickup

Quote
public OnGameModeInit()
{
AddStaticPickup (1, 410, -442.8760, -315.8749, 11.1867); // Hidden Package
AddStaticPickup (2, 356, -703.3553, -411.1085, 10.5188); // Box

2nd Step. to make a function of the pickup

Quote
public OnPickedUp(playerid,pickupid)
{
if ( pickupid == 1) // Function of 1st pickup
{
SetPlayerMoney(playerid,GetPlayerMoney(playerid) + 5000); // +5.000$ to the cash
SendClientMessage(playerid, JACK_WHITE, "You picked up hidden package! Award: 5000$");
}
if ( pickupid == 2) // Function of 2nd pickup
{
SetPlayerWeapon(playerid, 21, 500); // Gives a stubby
SendClientMessage(playerid, JACK_WHITE, "You picked up box with a stubby shotgun!");
}
return 1;
}

Pages: [1]