Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock Float:GetRealDistance(playerid, playerid2, unit)
- {
- new Float:Pos[3], Float:Pos2[3], Float:converter;
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerPos(playerid2, Pos2[0], Pos2[1], Pos2[2]);
- Pos[0] -= Pos2[0];
- Pos[1] -= Pos2[1];
- Pos[2] -= Pos2[2];
- switch(unit)
- {
- case 0: converter = 1.0; // Mét
- case 1: converter = 1.0/1000.0; // Kilo mét
- case 2: converter = (1.0/1000.0)/1.6; // Dặm
- case 3: converter = 100.0; // Centi mét
- case 4: converter = 39.3701; // Inch
- }
- return floatsqroot((Pos[0]*Pos[0]) + (Pos[1]*Pos[1]) + (Pos[2]*Pos[2]))*converter;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement