What is wrong with this? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What is wrong with this? (
/showthread.php?tid=69435)
What is wrong with this? -
notec100 - 18.03.2009
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!
Re: What is wrong with this? -
[RP]Rav - 18.03.2009
Код:
format(myString, sizeof(myString), "%s (%i) kisses the air!", ReturnPlayerName(playerid), playerid);
Код:
format(myString, sizeof(myString), "%s (%i) gives %s (%i) a kiss!", ReturnPlayerName(playerid), playerid, targetName, targetid);
Re: What is wrong with this? -
notec100 - 18.03.2009
Quote:
Originally Posted by Rav
Код:
format(myString, sizeof(myString), "%s (%i) kisses the air!", ReturnPlayerName(playerid), playerid);
Код:
format(myString, sizeof(myString), "%s (%i) gives %s (%i) a kiss!", ReturnPlayerName(playerid), playerid, targetName, targetid);
|
Ah I wasn't sure if I still needed to add in (,playerid) :/ but I guess you do :P Thanks a lot I will fix it and try it. Any issues, you know I will post :P! Other than that thank you very much!