01.01.2010, 15:36
With my /goto command ive made it so if you say the command and your not logged into rcon,
it says you are not an administrator, and if ur logged into rcon, the command works,
But because my /setcash is diffrent format im not so sure,
Heres my code? How do i make it, If you say /givecash it shows usage,
If you do /givecash [id] it again shows usage,
But if you do /givecash [id] [amount] It says, You are not an Administrator,
So what would i add onto this so it checks if player is logged into rcon,
And if he is, It lets him use the command,
But if hes not it says You are not an Administrator,
it says you are not an administrator, and if ur logged into rcon, the command works,
But because my /setcash is diffrent format im not so sure,
Heres my code? How do i make it, If you say /givecash it shows usage,
If you do /givecash [id] it again shows usage,
But if you do /givecash [id] [amount] It says, You are not an Administrator,
So what would i add onto this so it checks if player is logged into rcon,
And if he is, It lets him use the command,
But if hes not it says You are not an Administrator,
pawn Код:
dcmd_setcash(playerid, params[])
{
new
giveplayerid,
amount;
if (sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /givecash [playerid/partname] [amount]");
else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
else
{
ResetPlayerMoney(playerid);
GivePlayerMoney(giveplayerid, amount);
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Admin %s has set your cash to %d", name, amount);
SendClientMessage(giveplayerid, 0xFFFF00AA, string);
}
return 1;
}