fakecmd doesn't effects
#1

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;

Reply
#2

you don't need it to be a remote function, you can use CallLocalFunction with the "OnPlayerCommandText" function not string2
Reply
#3

Every command function starts with prefix cmd_
What you need to do is add prefix "cmd_ to string2
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)