[Tutorial] Simple Shop Command [EXPLAINED]
#1

Simple Shop Command [EXPLAINED]
Brought you by Mr.SmileyWinky!

Introduction:

Planning to add a shop on your GM that decrease your money?, well then you go to right tutorial.

Step by Step:

First of all add

pawn Code:
#include <zcmd>
under the a_samp or in other includes
You can download zcmd.inc on Filterscript and Includes section

second is we will gonna create the command. i will put my command at the bottom of my script.

pawn Code:
COMMAND:MJHotDog(playerid, params[])
{
    if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, MJCOLOR, "You do not have enough money to buy my hotdog special");
    GivePlayerMoney(playerid, -10);
    SendClientMessage(playerid, MJCOLOR, "Thank you for buying my very delicious MJ Hotdog");
    //Eating Animation
    return 1;
}
pawn Code:
if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, MJCOLOR, "You do not have enough money to buy my hotdog special");
Checks if player have 10$ if player doesn't have one the return SendClientMessage will be called.

pawn Code:
GivePlayerMoney(playerid, -10);
if player has 10$. his 10 will be decrease

pawn Code:
SendClientMessage(playerid, MJCOLOR, "Thank you for buying my very delicious MJ Hotdog");
After giving -10$, sendclientmessage will be called (if you only have 10$)

pawn Code:
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.0,0,0,0,0,0,0); //Credits to lamarr007
will play the eating animation, EAT_Burger is animation for now theres no EAT_Hotdog animation

Have fun creating your own shop

once again brought you by Mr.SmileyWinky!
Reply
#2

Thread updated!
Reply
#3

why adding picture? its just a simple command
Reply
#4

simple but nice 8/10
Reply
#5

thanks i'm making a gamemode features with my some tutorials
Reply
#6

Good one Joker!
Reply
#7

Nice tut
For animation you can use this :
pawn Code:
EAT_Burger
EAT_Chicken
EAT_Pizza
Reply
#8

nice work man :d 7/10
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)