What is wrong with this?
#1

Ok so I am making this command and I am trying to make it so if the player types /kiss and the params are empty then it will send a client message to all "so and so kisses the air". Then if they specify an id in the params it will send a client message to all saying "so and so gives so and so a kiss."
Код:
dcmd_kiss(playerid, params[]) //aa
{
  new targetid = strval(params);
	if(!IsPlayerConnected(targetid))
	{
		SendClientMessage(playerid, COLOR_ERROR, "That player is not connected!");
	}
	if(GetDistanceBetweenPlayers(playerid, targetid) > DISTANCE_BETWEEN_PLAYERS)
	{
	  LoopingAnim(playerid, "KISSING", "Playa_Kiss_02", 3.0, 1, 1, 1, 1, 0); // Kissing
		format(myString, sizeof(myString), "%s (%i) kisses the air!", ReturnPlayerName(playerid));
		SendClientMessageToAll(YELLOW, myString);
		return 1;
	}
	if(GetDistanceBetweenPlayers(playerid, targetid) < DISTANCE_BETWEEN_PLAYERS)
	{
	  LoopingAnim(playerid, "KISSING", "Playa_Kiss_02", 3.0, 1, 1, 1, 1, 0); // Kissing
		format(myString, sizeof(myString), "%s (%i) gives %s (%i) a kiss!", ReturnPlayerName(playerid), targetName, targetid);
		SendClientMessageToAll(YELLOW, myString);
		return 1;
	}
	return 1;
}
Now this issue is when you just type /kiss it will say so and so(with the wrong id but correct name) kisses (long unknown sequence of code). I just want it so if they type /kiss it send the message to all about kissing air, if they type /kiss id and are in range then the client message will say "so and so gives so and so a kiss." Could someone please help me or correct what is wrong in my code. I would really appreciate it! Thanks in advance!
Reply


Messages In This Thread
What is wrong with this? - by notec100 - 18.03.2009, 04:52
Re: What is wrong with this? - by [RP]Rav - 18.03.2009, 08:09
Re: What is wrong with this? - by notec100 - 18.03.2009, 10:00

Forum Jump:


Users browsing this thread: 2 Guest(s)