Problems with CMD
#5

Well it's clear you didn't leave a parameter to determine what 'giveplayerid' is. Since the idea is to quickly throw a rock at someone, perhaps you should make it decrease a players health instead of kill him/her. Also decreasing the length of the command name would be useful for on-the-fly command typing for example, "/ro <id or partofname>" would be useful. You could increase its efficiency by getting the names of nearby players so the command typing player won't have to be as precise with the player's name. For example, Bob is within 50m of the command typing player, and Bobby is 100m away from the command typing player. If you get the names of the players that are closer, the command typing player could just type "/ro b" and since the only player who's name has a 'b' in it and is within 50m of the command typing player, the rock will be thrown at Bob.

Determining if Player is close enough to a player
pawn Код:
PlayerNearPlayer(player1,player2,Float:distance)
{
    new Float:tmp[2][3];
    GetPlayerPos(player1,tmp[0][0],tmp[0][1],tmp[0][2]);
    GetPlayerPos(player2,tmp[1][0],tmp[1][1],tmp[1][2]);
    return ((((tmp[1][0]-tmp[0][0])*(tmp[1][0]-tmp[0][0]))+((tmp[1][1]-tmp[0][1])*(tmp[1][1]-tmp[0][1]))+((tmp[1][2]-tmp[0][2])*(tmp[1][2]-tmp[0][2])))<distance*distance);
}
Use DCMD or strtok to determine what the command typing player has for the 'giveplayerid'
Reply


Messages In This Thread
Problems with CMD - by mini-d - 10.06.2009, 06:12
Re: Problems with CMD - by Burridge - 10.06.2009, 06:15
Re: Problems with CMD - by Abernethy - 10.06.2009, 06:32
Re: Problems with CMD - by mini-d - 10.06.2009, 06:44
Re: Problems with CMD - by Joe Staff - 10.06.2009, 06:47

Forum Jump:


Users browsing this thread: 1 Guest(s)