Off Topic > PAWN Scripting
Simple /setmoney and /givemoeny command
(1/1)
Life:
/setmoney and /givemoney command that anyone can use!
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define COLOR_WHITE 0xFFFFFF
#define COLOR_BLACK 0x000000
#define COLOR_RED 0xFF0000
#define COLOR_GREEN 0x00FF00
#define COLOR_BLUE 0x0000FF
#define COLOR_YELLOW 0xFFFF00
#define COLOR_ORANGE 0xFFA500
#define COLOR_PURPLE 0x800080
CMD:setmoney(playerid, params[])
{
new money = strval(params);
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You are not connected to the server.");
if(money < 0) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid amount.");
SetPlayerMoney(playerid, money);
SendClientMessage(playerid, COLOR_GREEN, "Success: Your money has been set to $%d.", money);
return 1;
}
CMD:givemoney(playerid, params[])
{
new money = strval(params);
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You are not connected to the server.");
if(money < 0) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid amount.");
GivePlayerMoney(playerid, money);
SendClientMessage(playerid, COLOR_GREEN, "Success: You have been given $%d.", money);
return 1;
}
If there are any errors please let me know.
KSKSKSS:
how do we script a simple samp server? :(
I made a lan server but I don't know how to add cmds or admins :/ pls teach
Life:
go to the samp website download a server go to pawno and make a new pawnno file and copy and paste the code then press compile
Kepp in mind that you need 1 include and 1 plugin the plugin name is sscanf and the include name is zcmd.
KSKSKSS:
:suicide:
Is there any detailed video that you can send to me ;-;
xgg:
maybe next time simple ATM/Bank ( ͡° ͜ʖ ͡°)
Navigation
[0] Message Index
Go to full version