04.09.2015, 19:37
the parameters of the cmd is /fakecmd [player id] [cmd] , when i do it sends a msg to the adminstrator that the fake command is sent , however nothing happens , i use zcmd (CMD) in all the commands i have in my gamemode , here's the code
Thanks
Код:
CMD:fakecmd(playerid,params[])
{
if(!IsPlayerAnAdmin(playerid,5))return SendClientMessage(playerid,0xFF0000FF,"<!>You are not authorized to use this command!");
new string2[128],command[128],string3[128];
new pID, SpielerName[MAX_PLAYER_NAME];
GetPlayerName(pID, SpielerName, sizeof(SpielerName));
if(sscanf(params, "us", pID,string2)) return SendClientMessage(playerid, COLOR_GREEN, "/fakecmd [id] [command]");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "The fakecommand has been send.");
format(command,sizeof(command),"%s",string2);
for(new i=0;i<GetMaxPlayers();i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAnAdmin(i,1))
{
format(string3,sizeof(string3),"A: %s [LEVEL %i] used the FAKECMD command.",PlayerName(playerid),GetPVarInt(playerid,"Admin"));
SendClientMessage(i,COLOR_ORANGE,string3);
}
}
}
OnPlayerCommandText(pID,command);
return 1;
}

