Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Castagna on February 18, 2011, 03:35:31 am

Title: Function for pickups in PAWNO! HELP
Post by: Castagna on February 18, 2011, 03:35:31 am
 Hi everyone , I was makking a race cmd , and y need  to put function for a pickup... I try to made something in OnplayerPickup but i couldn't get nothing . >:( I wan't to put something like a  SendClientMessage , and money reward , ... Pleasee i need some help  ;D

                                                                   thx for all  :)
Title: Re: Function for pickups in PAWNO! HELP
Post by: Charleyutton on February 21, 2011, 03:03:46 pm
The callback/event for picking up a pickup is not OnplayerPickup.

It's OnPickedUp.
Code: [Select]
public OnPickedUp(pickupid, playerid)
{
SendClientMessage(playerid,COLOR_YELLOW,"Hey, you picked something!");
return 1;
}
Title: Re: Function for pickups in PAWNO! HELP
Post by: Robd on February 21, 2011, 11:49:04 pm
If you want to give each pickup an individual function....
first: Find the ID of the pickup you want (the first argument  on AddStaticPickup)
and then put
Code: [Select]
if (pickupid == <ID of pickup>
    SendClientMessage(playerid,COLOR_GREEN,"You found a cookie");
    return 1;
Title: Re: Function for pickups in PAWNO! HELP
Post by: Castagna on February 22, 2011, 03:17:23 am
ahh , very helpful! ;D


                     thx for all guys !!!  ;)
Title: Re: Function for pickups in PAWNO! HELP
Post by: Castagna on February 22, 2011, 08:09:15 pm
But in witch part i have to put the code in script  ???
Title: Re: Function for pickups in PAWNO! HELP
Post by: shivambansal on February 22, 2011, 08:47:09 pm
In your server files there's a folder name scriptfiles go and inside the folder there's a folder named pickups
paste it.
Title: Re: Function for pickups in PAWNO! HELP
Post by: Castagna on February 22, 2011, 10:46:40 pm
I put this on scriptfiles/pickups
Quote
public OnPickedUp(71, playerid)
{
   SendClientMessage(playerid,COLOR_YELLOW,"You drunk a beer!");
             SetPlayerDrunk(playerid,300,true);             

   return 1;

And in script i put
Quote
AddStaticPickup(71,413,-870.22479248,-297.36553955,11.15551948);
on public OnGameModeInit()

And them I go to the malibu club , witch is the location of the pickup , and when I eat the pickup , there's not player drunk, and appears the function of a properties

       
Quote
<<< >>>
<ID>[71] <owner> [none]

What  I'm doing wrong, I'll go crazy  ??? :-\
Title: Re: Function for pickups in PAWNO! HELP
Post by: Robd on February 24, 2011, 02:20:19 am
try
Code: [Select]
OnPickedUp(pickupid,playerid)
{
    if(pickupid == 71) {
        SendClientMessage(playerid,COLOR_GREEN,"You drink a bear");
        SetPlayerDrunk(playerid,300,true);
    }
    return 1;
}