Been looking for about an hour.
#6

Quote:
Originally Posted by Weirdosport
pawn Код:
#include <a_samp>

//#############################
//##   Change these:  ##
//#############################

#define GUNID 27
#define GUNCOST 1000
#define AMMO 500
#define COLOR 0xFF00FFFF

//#############################

new String[128];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/buyspaz", cmdtext, true, 10) == 0)
    {
        if(GetPlayerMoney(playerid) >= GUNCOST)
        {
          GivePlayerWeapon(playerid, GUNID, AMMO);
          SendClientMessage(playerid, COLOR, "Enjoy your spaz!");
        }
        else
        {
          format(String, sizeof(String), "You need at least %d to buy a Spaz!", GUNCOST);
          SendClientMessage(playerid, COLOR, String);
        }
        return 1;
    }
    return 0;
}
Wow, another reply within 10 minutes, hehe

Is there a point in defining the numbers the top, since you could put them in the script it self?

For example #define GUNID 27

Couldn't you just type in 27 for the gunID, instead of defining it, just makes more sence to me.
Reply


Messages In This Thread
Been looking for about an hour. - by whereschris - 08.07.2009, 22:06
Re: Been looking for about an hour. - by Chaprnks - 08.07.2009, 22:13
Re: Been looking for about an hour. - by whereschris - 08.07.2009, 22:16
Re: Been looking for about an hour. - by Weirdosport - 08.07.2009, 22:17
Re: Been looking for about an hour. - by Chaprnks - 08.07.2009, 22:19
Re: Been looking for about an hour. - by whereschris - 08.07.2009, 22:19
Re: Been looking for about an hour. - by Weirdosport - 08.07.2009, 22:19
Re: Been looking for about an hour. - by Chaprnks - 08.07.2009, 22:20
Re: Been looking for about an hour. - by whereschris - 08.07.2009, 22:22
Re: Been looking for about an hour. - by Chaprnks - 08.07.2009, 22:23

Forum Jump:


Users browsing this thread: 2 Guest(s)