SA-MP Forums Archive
Its not setting the waypoint. - 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: Its not setting the waypoint. (/showthread.php?tid=563762)



Its not setting the waypoint. - lulo356 - 16.02.2015

Hello, i've an issue, when someone calls the medics or police its not setting the waypoint,

pawn Code:
switch (PlayerData[playerid][pEmergency])
        {
            case 1:
            {
                if (!strcmp(text, "police", true))
                {
                    PlayerData[playerid][pEmergency] = 2;
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "[OPERATOR]:{FFFFFF} You've been dispatched to police HQ. Please describe the crime.");
                }
                else if (!strcmp(text, "medics", true))
                {
                    PlayerData[playerid][pEmergency] = 3;
                    SendClientMessage(playerid, COLOR_HOSPITAL, "[OPERATOR]:{FFFFFF} You've been dispatched to medical HQ. Please describe the emergency.");
                }
                else SendClientMessage(playerid, COLOR_LIGHTBLUE, "[OPERATOR]:{FFFFFF} Sorry, I don't understand. Do you require \"police\" or \"medics\"?");
            }
            case 2:
            {
                SendFactionMessageEx(FACTION_POLICE, COLOR_RADIO, "911 CALL: %s (%s)", ReturnName(playerid, 0), GetPlayerLocation(playerid));
                SendFactionMessageEx(FACTION_POLICE, COLOR_RADIO, "DESCRIPTION: %s", text);

                SendClientMessage(playerid, COLOR_LIGHTBLUE, "[OPERATOR]:{FFFFFF} We have alerted all units in the area.");
                cmd_hangup(playerid, "\1");

                SetFactionMarker(playerid, FACTION_POLICE, 0x00D700FF);
            }
            case 3:
            {
                SendFactionMessageEx(FACTION_MEDIC, COLOR_HOSPITAL, "911 CALL: %s (%s)", ReturnName(playerid, 0), GetPlayerLocation(playerid));
                SendFactionMessageEx(FACTION_MEDIC, COLOR_HOSPITAL, "DESCRIPTION: %s", text);

                SendClientMessage(playerid, COLOR_HOSPITAL, "[OPERATOR]:{FFFFFF} We have alerted all units in the area.");
                cmd_hangup(playerid, "\1");

                SetFactionMarker(playerid, FACTION_MEDIC, 0x00D700FF);
            }
        }



Re: Its not setting the waypoint. - Jimmy0wns - 16.02.2015

The first thing I don't get is where it actually retrieves the coordinates to make the waypoint.


Re: Its not setting the waypoint. - lulo356 - 16.02.2015

Quote:
Originally Posted by Jimmy0wns
View Post
The first thing I don't get is where it actually retrieves the coordinates to make the waypoint.
pawn Code:
SetFactionMarker(playerid, type, color)
{
    foreach (new i : Player) if (GetFactionType(i) == type) {
        SetPlayerMarkerForPlayer(i, playerid, color);
    }
    PlayerData[playerid][pMarker] = 1;
    SetTimerEx("ExpireMarker", 300000, false, "d", playerid);
    return 1;
}