Mike's Cops and Robbers

Off Topic => PAWN Scripting => Topic started by: Life on March 11, 2023, 09:13:30 am

Title: Simple /setmoney and /givemoeny command
Post by: Life on March 11, 2023, 09:13:30 am
/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.
Title: Re: Simple /setmoney and /givemoeny command
Post by: KSKSKSS on March 11, 2023, 09:17:24 am
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
Title: Re: Simple /setmoney and /givemoeny command
Post by: Life on March 11, 2023, 09:19:01 am
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.
Title: Re: Simple /setmoney and /givemoeny command
Post by: KSKSKSS on March 11, 2023, 01:43:17 pm
:suicide:

Is there any detailed video that you can send to me ;-;
Title: Re: Simple /setmoney and /givemoeny command
Post by: xgg on March 11, 2023, 05:03:01 pm
maybe next time simple ATM/Bank ( ͡° ͜ʖ ͡°)