SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/02/2017, 07:44 AM   #1
rakinz
Little Clucker
 
Join Date: Oct 2016
Posts: 44
Reputation: 0
Default fakecmd doesn't effects

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(playeridparams[])
{
if(
PlayerInfo[playerid][pAdmin] <= 4) return SendClientMessage(playeridCOLOR_RED"ERROR: Insufficient Permissions!");
if(
Dead[playerid] == 1) return SendClientMessage(playeridCOLOR_RED"[INFO]You can't use commands while being dead!");
new 
string2[20];
new 
TargetID;
if(
sscanf(params"us[20]"TargetID,string2)) return SendClientMessage(playeridCOLOR_LIGHTGREEN"Usage: /Fakecmd [PlayerID/PartOfName] [Command]");
SendClientMessage(playerid0x00FFFFFF"Fake CMD Sent.");
CallRemoteFunction(string2,"d",TargetID);
return 
1;

rakinz is offline   Reply With Quote
Old 18/02/2017, 07:51 AM   #2
cessil
High-roller
 
cessil's Avatar
 
Join Date: Apr 2009
Posts: 1,346
Reputation: 296
Default Re: fakecmd doesn't effects

you don't need it to be a remote function, you can use CallLocalFunction with the "OnPlayerCommandText" function not string2
cessil is offline   Reply With Quote
Old 18/02/2017, 07:52 AM   #3
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,151
Reputation: 215
Default Re: fakecmd doesn't effects

Every command function starts with prefix cmd_
What you need to do is add prefix "cmd_ to string2
DRIFT_HUNTER is offline   Reply With Quote
Old 18/02/2017, 08:46 AM   #4
rakinz
Little Clucker
 
Join Date: Oct 2016
Posts: 44
Reputation: 0
Default Re: fakecmd doesn't effects

Quote:
Originally Posted by DRIFT_HUNTER View Post
Every command function starts with prefix cmd_
What you need to do is add prefix "cmd_ to string2
Thanks man.. +repped you
rakinz is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with /fakecmd command +Rep freeze98 Scripting Help 6 01/09/2014 06:39 PM
/Fakecmd Blackazur Scripting Help 2 09/07/2013 05:56 PM
[Pedido] /FakeCmd e /FakeKill dinhocap Português/Portuguese 6 20/04/2013 04:37 AM


All times are GMT. The time now is 06:22 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.