Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started 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 :)
-
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;
}
-
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;
-
ahh , very helpful! ;D
thx for all guys !!! ;)
-
But in witch part i have to put the code in script ???
-
In your server files there's a folder name scriptfiles go and inside the folder there's a folder named pickups
paste it.
-
I put this on scriptfiles/pickups
public OnPickedUp(71, playerid)
{
SendClientMessage(playerid,COLOR_YELLOW,"You drunk a beer!");
SetPlayerDrunk(playerid,300,true);
return 1;
And in script i put 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
<<< >>>
<ID>[71] <owner> [none]
What I'm doing wrong, I'll go crazy ??? :-\
-
try
OnPickedUp(pickupid,playerid)
{
if(pickupid == 71) {
SendClientMessage(playerid,COLOR_GREEN,"You drink a bear");
SetPlayerDrunk(playerid,300,true);
}
return 1;
}