Hullo~
I'm making a new post about this since I tried to come up with a better way to do it (without deprotecting the map and looking for the Rects in map editor) and wanted peoples' opinions on if there is a better way to do it. So, essentially, I take a "-ping xxx.xx,xxx.xx,xxx.xx" command that looks for a X,Y,Duration for a map ping. I figured this would be an easy format to use since most of the Rect creations in JASS use "x,y,x2,y2".
Code:
function PingLoc takes player p2p,string s2s returns nothing
local real xLoc=0.0
local real yLoc=0.0
local real pingDuration=0.0
local integer loopCounter=0
local integer stringLength=StringLength(s2s)
local integer loopDone=0
local integer xIndex=0
loop
exitwhen loopDone==2 or loopCounter>stringLength
if SubString(s2s,loopCounter,loopCounter+1)==","then
if loopDone==0then
set xLoc=S2R(SubString(s2s,0,loopCounter))
set xIndex=loopCounter+1
set loopDone=loopDone+1
endif
if (loopDone==1)and(loopCounter!=xIndex-1)then
set yLoc=S2R(SubString(s2s,xIndex,loopCounter))
set pingDuration=S2R(SubString(s2s,loopCounter+1,stringLength))
set loopDone=loopDone+1
endif
endif
set loopCounter=loopCounter+1
endloop
call DisplayTextToPlayer(p2p,0,0,"Ping X:"+R2S(xLoc)+" Y:"+R2S(yLoc)+" Duration:"+R2S(pingDuration))
call PingMinimapForPlayer(p2p,xLoc,yLoc,pingDuration)
endfunction