Greet command - 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)
+--- Thread: Greet command (
/showthread.php?tid=399254)
Greet command -
PaulDinam - 13.12.2012
I made this so far:
Код:
CMD:greet(playerid, params[])
{
new pid, type, string[256];
if(sscanf(params,"dd",pid,type)) {
SCM(playerid, COLOR_GREY, "USAGE: /greet [playerid] [style]");
SCM(playerid, COLOR_GREEN, "[1] Kiss [2] Handshake [3] Handshake [4] Handshake [5] Handshake");
SCM(playerid, COLOR_GREEN, "[6] Handshake [7] Handshake [8] Handshake [9] Handshake [10] Handshake");
return 1;
}
if(pid == playerid) return SCM(playerid, COLOR_GREY, "You cannot greet yourself");
if(!IsPlayerConnected(pid)) return SCM(playerid, COLOR_GREY, "SERVER: This player is not connected");
if(!ProxDetectorS(3.5, playerid, pid)) return SCM(playerid, COLOR_LIGHTRED, "SERVER: That player is too far from you.");
sentGreet[playerid] = 1;
greetFrom[pid] = playerid;
format(string, sizeof(string), "* You have sent to %s a greet request.", GetName(pid));
SCM(playerid, COLOR_LIGHTGREEN, string);
format(string, sizeof(string), "* %s has sent you a greet request /acceptshake [playerid] to accept.", GetName(playerid));
SCM(pid, COLOR_LIGHTGREEN, string);
return 1;
}
I don't know the anims type or ID for handshake and KISS, and how to add check if players infront of each other.
like face to face
Re: Greet command -
DaRk_RaiN - 13.12.2012
The kiss ID
pawn Код:
LoopingAnim(playerid, "KISSING", "Playa_Kiss_02", 3.0, 1, 1, 1, 1, 0);
if you want to check if they are close to each other use IsPlayerInRangeOfPoint.
Re: Greet command -
PaulDinam - 13.12.2012
i can use ProxDetectorS
but how do i exactly check, if the player is in the right position.
if the player turns with his back?
Re: Greet command -
DaRk_RaiN - 13.12.2012
I don't think that's possible.
Re: Greet command -
Mean - 13.12.2012
Gave me a perfect idea. There IS a way to detect if the players are opposite, get their both facing angles and if the difference is around 180, they're standing in front of eachother.