08.07.2009, 22:17
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);
GivePlayerMoney(playerid, -GUNCOST);
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;
}