a jesam, ubacio sam..
evo kod!
#include
#include
stock ArePlayersFacing(playerid, targetid) {
new
Float:angle1,
Float:angle2,
Float:difference
;
GetPlayerFacingAngle(playerid, angle1);
GetPlayerFacingAngle(targetid, angle2);
if(angle1 > angle2) difference = angle1 - angle2;
else difference = angle2 - angle1;
if(difference < 190 && difference > 170) return 1;
return 0;
}
CMD:poljubac(playerid, params[]) {
new id = strval(params);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000, #ERROR: Igrac nije online!);
if(isnull(params)) return SendClientMessage(playerid, -1, #KORISTI: /poljubac );
new
Float:x,
Float:y,
Float:z
;
GetPlayerPos(id, x, y, z);
if(ArePlayersFacing(playerid, id) && IsPlayerInRangeOfPoint(playerid, 1.5, x, y, z)) {
new
string,
aName,
pName
;
GetPlayerName(playerid, aName, sizeof aName);
GetPlayerName(id, pName, sizeof pName);
ApplyAnimation(playerid, "KISSING", "Playa_Kiss_02", 10.0, 0, 0, 0, 0, 5000, 1);
ApplyAnimation(id, "KISSING", "Playa_Kiss_02", 10.0, 0, 0, 0, 0, 5000, 1);
format(string, sizeof string, #Dobili ste poljubac od %s!, aName);
SendClientMessage(id, -1, string);
format(string, sizeof string, #Poljubili ste %s!, pName);
SendClientMessage(playerid, -1, string);
}
else SendClientMessage(playerid, 0xFF0000, #ERROR: Igrac kojeg zelite poljubiti nije kraj vas ili nije online!);
return 1;
}