What's wrong with this command?
#9

You should know how to fix that error. Either remove it, or add this

PHP код:
IsPlayerNearPlayer(playeridtargetidFloat:radius)
{
    static
        
Float:fX,
        
Float:fY,
        
Float:fZ;
    
GetPlayerPos(targetidfXfYfZ);
    return (
GetPlayerInterior(playerid) == GetPlayerInterior(targetid) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(targetid)) && IsPlayerInRangeOfPoint(playeridradiusfXfYfZ);

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
No because it's nothing from the command itself, You should do something like.. An array defined globally that stores the ID of the player getting arrested, so you can use this array instead of "targetid".. Example:

You can create either an array or an enum..

PHP код:
enum pinfo
{
     
pArresting
}
new 
PlayerInfo[MAX_PLAYERS][pinfo]; 
or an array..

PHP код:
new ArrestingPlayer[MAX_PLAYERS]; 
PHP код:
cmd:arrest(playeridparams[])
{
      new 
targetid;
      if(
sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_RED"/arrest [target]");
      
ArrestingPlayer[playerid] = targetid;

or
PHP код:
cmd:arrest(playeridparams[])
{
      new 
targetid;
      if(
sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_RED"/arrest [target]");
      
PlayerInfo[playerid][pArresting] = targetid;

and instead of using "targetid" in the "/bc" command, use the enum or the array..
I understand where you're coming from, but you can just make a parameter in the command itself to get the input from the user on who is arresting them.
Reply


Messages In This Thread
What's wrong with this command? - by Thanks - 10.07.2018, 23:29
Re: What's wrong with this command? - by JasonRiggs - 10.07.2018, 23:52
Re: What's wrong with this command? - by Thanks - 11.07.2018, 00:05
Re: What's wrong with this command? - by JasonRiggs - 11.07.2018, 00:23
Re: What's wrong with this command? - by Thanks - 11.07.2018, 00:31
Re: What's wrong with this command? - by Tass007 - 11.07.2018, 00:44
Re: What's wrong with this command? - by JasonRiggs - 11.07.2018, 00:46
Re: What's wrong with this command? - by Thanks - 11.07.2018, 00:50
Re: What's wrong with this command? - by Tass007 - 11.07.2018, 00:59
Re: What's wrong with this command? - by Thanks - 11.07.2018, 01:14

Forum Jump:


Users browsing this thread: 3 Guest(s)