• Welcome to Vice City Multiplayer.
 

Function for pickups in PAWNO! HELP

Started by Castagna96, February 18, 2011, 01:35:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Castagna96

 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  :)

Charleyutton

#1
The callback/event for picking up a pickup is not OnplayerPickup.

It's OnPickedUp.
public OnPickedUp(pickupid, playerid)
{
SendClientMessage(playerid,COLOR_YELLOW,"Hey, you picked something!");
return 1;
}

Charleyutton, VU clan leader, VCDC co-creator, SvM Server Owner, Squirrel Scripter. http://vu.vrocker-hosting.co.uk http://svm.vrocker-hosting.co.uk XE Scripter

Robd

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
if (pickupid == <ID of pickup>
    SendClientMessage(playerid,COLOR_GREEN,"You found a cookie");
    return 1;
Hello, this is Robd from the past.
If you are seeing this I have either posted something stupid, forgotten something, started a stupid topic, or a combination of the three.

Please forgive us for this mistake.

Regards, management

Castagna96

ahh , very helpful! ;D


                     thx for all guys !!!  ;)

Castagna96

But in witch part i have to put the code in script  ???

shivambansal

In your server files there's a folder name scriptfiles go and inside the folder there's a folder named pickups
paste it.

Castagna96

I put this on scriptfiles/pickups
Quotepublic OnPickedUp(71, playerid)
{
   SendClientMessage(playerid,COLOR_YELLOW,"You drunk a beer!");
             SetPlayerDrunk(playerid,300,true);             

   return 1;

And in script i put
QuoteAddStaticPickup(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  ??? :-\

Robd

try
OnPickedUp(pickupid,playerid)
{
    if(pickupid == 71) {
        SendClientMessage(playerid,COLOR_GREEN,"You drink a bear");
        SetPlayerDrunk(playerid,300,true);
    }
    return 1;
}
Hello, this is Robd from the past.
If you are seeing this I have either posted something stupid, forgotten something, started a stupid topic, or a combination of the three.

Please forgive us for this mistake.

Regards, management