fakecmd doesn't effects - 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)
+--- Thread: fakecmd doesn't effects (
/showthread.php?tid=628985)
fakecmd doesn't effects -
rakinz - 18.02.2017
I've tried to make an /fakecmd for administrators. but when I try
the command ingame it doesn't make any cmd for the "TargetID"..
If someone could fix it or tell me what I did wrong I will be thankful.
PHP Code:
CMD:fakecmd(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 4) return SendClientMessage(playerid, COLOR_RED, "ERROR: Insufficient Permissions!");
if(Dead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "[INFO]You can't use commands while being dead!");
new string2[20];
new TargetID;
if(sscanf(params, "us[20]", TargetID,string2)) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "Usage: /Fakecmd [PlayerID/PartOfName] [Command]");
SendClientMessage(playerid, 0x00FFFFFF, "Fake CMD Sent.");
CallRemoteFunction(string2,"d",TargetID);
return 1;
}
Re: fakecmd doesn't effects -
cessil - 18.02.2017
you don't need it to be a remote function, you can use CallLocalFunction with the "OnPlayerCommandText" function not string2
Re: fakecmd doesn't effects -
DRIFT_HUNTER - 18.02.2017
Every command function starts with prefix cmd_
What you need to do is add prefix "cmd_ to string2
Re: fakecmd doesn't effects -
rakinz - 18.02.2017
Quote:
Originally Posted by DRIFT_HUNTER
Every command function starts with prefix cmd_
What you need to do is add prefix "cmd_ to string2
|
Thanks man.. +repped you