[Tutorial] How to create Pickups [Simple]
#1

Hello this is the first post after i joined sa-mp forum, im a new scripter and i have some knowledge that may help the other scripting beginners, and today ill make a tutorial about pickups.
pickups are icons they might look like guns or another icon models.
for the pickup models and types visit : https://sampwiki.blast.hk/wiki/Pickup_IDs
Lets start!
im gonna make a marker, lets define it
PHP код:
new marker
now after that we need to explain what "marker" is so the script can understand
under
PHP код:
public OnFilterScriptInit() 
or
PHP код:
public OnGameModeInit() 
write:
PHP код:
marker CreatePickup(131811654.0273,-1655.9581,22.5156);//(model,type,z,x,y); 
now you can see the pickup IG but its useless so we gonna enter a job for it, and this pickup is used to send me a message now , look for this function:
PHP код:
public OnPlayerPickUpPickup(playeridpickupid
this function works if the player walked through the pickup so now under it ,write:
PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == marker
    {
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"*/enter to enter this building!"); // Message the player
    
}
    return 
1;

in the last it should look like this :
PHP код:
#include <a_samp>
#if defined FILTERSCRIPT
new marker;
public 
OnFilterScriptInit()
{
    
marker CreatePickup(131811654.0273,-1655.9581,22.5156);// model,type,z,x,y
    
return 1;
}
public 
OnPlayerPickUpPickup(playeridpickupid)//pickup related function
{
    if(
pickupid == marker)//this to make sure that the pickup we want is marker
    
{
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"*/enter to enter this building!"); // Message the player
    
}
    return 
1;

sorry for my bad english , if you didnit understand any part please reply and this is my first tutorial so be easy on me if it wasnt that good :P, please rate it
Reply


Messages In This Thread
How to create Pickups [Simple] - by xMCx - 08.09.2012, 13:03
Re: How to create Pickups [Simple] - by XStormiest - 08.09.2012, 14:36
Re: How to create Pickups [Simple] - by xMCx - 08.09.2012, 14:40
Re : How to create Pickups [Simple] - by Crazy_Sniper - 13.09.2012, 15:40
Re: Re : How to create Pickups [Simple] - by xMCx - 13.09.2012, 15:47
Re: How to create Pickups [Simple] - by [LB]BlAcK_DeViL - 13.09.2012, 15:53
Re: How to create Pickups [Simple] - by MoDee - 13.09.2012, 16:20
Re: How to create Pickups [Simple] - by xMCx - 13.09.2012, 16:21
Re: How to create Pickups [Simple] - by [LB]BlAcK_DeViL - 20.09.2012, 23:10
Re: How to create Pickups [Simple] - by dino_d_carter - 03.12.2012, 19:49

Forum Jump:


Users browsing this thread: 1 Guest(s)