05.12.2014, 20:52
I need help making a rape command. I cant figure out the distance situation. obviously you need to be close to someone to rape him.
Can anybody just help me to figure out the distance situation in this command. any help will be appreciated.
Quote:
CMD:rape(playerid,params[]) { new id; new result[128]; new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME]; if (sscanf(params, "dz" ,id)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage:\"/rape [ID]\""); else if (!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Invalid ID"); else if (!IsPlayerInRangeOfPoint(id)) return SendClientMessage(playerid, COLOR_RED, "The player is not near you"); else { GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(id, name2, sizeof(name2)); format(result, sizeof(result),"{CC6600}%s {FFFFFF}has infected {CC6600}%s {FFFFFF}with {CC6600} Chlamydia",name,name2); SendClientMessageToAll(COLOR_WHITE,result); } return 1; } |