15.10.2013, 09:52
(
Последний раз редактировалось iFiras; 11.09.2014 в 03:17.
)
Deleted.
stock GetClosestPlayer(playerid)
{
new Float:cdist, targetid = -1;
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && GetPlayerState(i) != PLAYER_STATE_SPECTATING && playerid != i && (targetid < 0 || cdist > GetDistanceBetweenPlayers(playerid, i)))
{
targetid = i;
cdist = GetDistanceBetweenPlayers(playerid, i);
}
}
return targetid;
}
//
new Tplayer = GetClosestPlayer(playerid);// use this in command
//
Hey guys, Please anyone can give me a /rape command like when you be near a player you do /rape you rape the player, doing /rape without specifing ID of player. I need this command for my CNR server
|
GetPlayerPos(playerid,x,y,z);
if(IsPlayerInRangeOfPoint(Tplayer,6.0,x,y,z)){
SendClientMessage(Tplayer, COLOR_RED,"You have been raped!"); //send message to Tplayer(target)
SendClientMessage(playerid, COLOR_RED,"You have raped target player"); // send message to playerid (user)
// code
}else{
SendClientMessage(playerid, COLOR_RED,"No one is close enough.");// similarly
}