Distance to Number. (+REP!)
#1

I want use the function GetPlayerDistanceOfPoint but i want to transform the distance to cash, I mean if it's more far so it would give you more cash, it's pretty hard to explain it but i hope u understood me
Reply
#2

Just convert the floating point number into a whole number:
pawn Код:
new cash = floatround(GetPlayerDistanceFromPoint(playerid, 0.0, 0.0, 0.0));
GivePlayerMoney(playerid, cash);
Reply
#3

You can use something like this:
PHP код:
new Float:distance GetPlayerDistanceFromPoint(playerid,x,y,x);
if(
distance 10) return GivePlayerMoney(playerid,100);
else if(
distance 10 || distance 20) return GivePlayerMoney(playerid,200); 
And continue like this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)