SA-MP Forums Archive
How to store a players location in a string? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to store a players location in a string? (/showthread.php?tid=557331)



How to store a players location in a string? - Ciarannn - 13.01.2015

I have a command for the people to call a mechanic, but I then want it to send all the mechanics a message like:

Caller: John Lawson
Location: %s
Situation: I need a tow.

How do I get the callers location and store it in a string so I can send it to the Mechanics?


Re: How to store a players location in a string? - erminpr0 - 13.01.2015

Use zonesystem filterscript if you want, https://sampforum.blast.hk/showthread.php?tid=161741

pawn Код:
new ZoneName[MAX_ZONE_NAME];
GetPlayer2DZone(callerid, ZoneName, MAX_ZONE_NAME);
new callerName[MAX_PLAYER_NAME]; GetPlayerName(callerid, callerName, MAX_PLAYER_NAME);
new string[128];
format(string, sizeof string, "Caller: %s, Location: %s", callerName, ZoneName);
for(new i = 0; i != MAX_PLAYERS; i++) if(/*if is player mechanic*/) SendClientMessage(i, 0xFFFFFFFF, string);



Re: How to store a players location in a string? - Ciarannn - 13.01.2015

Quote:
Originally Posted by erminpr0
Посмотреть сообщение
Use zonesystem filterscript if you want, https://sampforum.blast.hk/showthread.php?tid=161741

pawn Код:
new ZoneName[MAX_ZONE_NAME];
GetPlayer2DZone(callerid, ZoneName, MAX_ZONE_NAME);
new callerName[MAX_PLAYER_NAME]; GetPlayerName(callerid, callerName, MAX_PLAYER_NAME);
new string[128];
format(string, sizeof string, "Caller: %s, Location: %s", callerName, ZoneName);
for(new i = 0; i != MAX_PLAYERS; i++) if(/*if is player mechanic*/) SendClientMessage(i, 0xFFFFFFFF, string);
Thanks man, I appreciate it [+Rep for you ]