WTF is wrong with this cmd :S? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: WTF is wrong with this cmd :S? (
/showthread.php?tid=156249)
WTF is wrong with this cmd :S? -
Ehab_Isaac101 - 21.06.2010
hey, I made this cmd and it doesn't work i can't figure out why
Код:
public OnRconCommand(cmd[])
{
if (strcmp(cmd, "/ecash", true)==0)
{
printf("You just gave a player 10 thousand dollars!",cmd);
SetPlayerMoney(playerid, 10000);
return 1;
}
return 0;
}
Re: WTF is wrong with this cmd :S? -
Sergei - 21.06.2010
There is no playerid which you could give money to. Use sscanf to split params and get possible player you are looking for.
Re: WTF is wrong with this cmd :S? -
Brian_G - 21.06.2010
Код:
public OnRconCommand(cmd[])
{
if (strcmp(cmd, "/ecash", true)==0)
{
SendClientMessage(playerid, COLOR_GREEN, "You just gave a player 10 thousand dollars!");
SetPlayerMoney(playerid, 10000);
return 1;
}
Note: you can change the color.
Re: WTF is wrong with this cmd :S? -
Westie - 21.06.2010
As far as I know, OnRconCommand has no playerid attribute.
Also, RCON commands do not work like /command. Unless you intend to access it like /rcon /command, but that's stupid.
Re: WTF is wrong with this cmd :S? -
Hiddos - 21.06.2010
From wiki:
Quote:
This callback is called when a player types things into the RCON console. This only works in filterscripts, however.
|
And I still don't think you will be able to make a new RCON command ^^.
Use OnPlayerCommandText, with IsPlayerAdmin if you want him to be RCON
Re: WTF is wrong with this cmd :S? -
Agent Smith - 21.06.2010
You can use IsPlayerAdmin
Use it like you would on a normal command but IsPlayerAdmin checks if you are an RCON admin.
https://sampwiki.blast.hk/wiki/IsPlayerAdmin
I have tested with a command in my script and it does work.