Command Usage
#1

Is it possible to make a command with parameter and without parameter at the same time? like for instance,/slap
if i just type it just like that. it would look for the closest person to slap,if i input a parameter it would look for that specific player. i dont want it to show like /slap [name/id] Thanks.
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=602923

Quote:
Originally Posted by ******
pawn Код:
sscanf(params, "U(-1)", id);
if (id == -1)
{
    // No player was entered.
}
else if (id == INVALID_PLAYER_ID)
    // Entered player is not connected.
}
Reply
#3

So, instead of returning that message you find the closest player.

PHP код:
new targetid INVALID_PLAYER_ID;

if(
sscanf(params"r"targetid))
{
    
targetid FindClosest(...);
}

SetPlayerPos(targetid, ...); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)