[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
#2

easy but good for newbie
Reply
#3

thanks
Reply
#4

thank you , you helped me a lot!
Reply
#5

Quote:
Originally Posted by Crazy_Sniper
Посмотреть сообщение
thank you , you helped me a lot!
no problem
Reply
#6

good work
Reply
#7

Great tutorial for newbies
Reply
#8

Yes , thanks , ill help more as i can
Reply
#9

But How To Make it as Dilog Text ??
Reply
#10

Nice +rep i like all yous tutorials
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)