07.08.2009, 22:06
Hello!
im making some changes in my script, for Mechanics.
You call 123 to contact the towing service, and tell your position and a Mechanic on duty will receive a message that a Mechanic is needed.
but now i want a marker on mini map so it will be easier to find the player when he has call for a mechanic.
the code is
And
so how do i put SetPlayerMarkerForPlayer for mechanics when someone calls for a towing and remove it when hes there? also a checkpoint could work?
im making some changes in my script, for Mechanics.
You call 123 to contact the towing service, and tell your position and a Mechanic on duty will receive a message that a Mechanic is needed.
but now i want a marker on mini map so it will be easier to find the player when he has call for a mechanic.
the code is
Код:
if(Mobile[playerid] == 123) { if(!strlen(tmp)) { SCM(playerid, COLOR_YELLOW, "Mechanic Central: What's your current position?"); return 0; } strmid(WorkAtom[playerid][Description], text, 0, strlen(text), 255); new UserName2[MAX_PLAYER_NAME]; new giveplayerid = ReturnUser(tmp); SCM(playerid, COLOR_YELLOW, "Mechanic Central Says: We will dispatch a car as soon as possible!"); GetPlayerName(giveplayerid, UserName2, sizeof(UserName2)); format(Text, sizeof(Text), "Tow Truck needed by %s, Position: %s", UserName, WorkAtom[playerid][Description]); SendOnDutyMecMessage(Text); SCM(playerid, COLOR_YELLOW, "They hung up!"); Mobile[playerid] = 255; SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE); return 0; } if(IsPlayerConnected(Mobile[playerid])) { if(Mobile[Mobile[playerid]] == playerid) { SCM(Mobile[playerid], COLOR_YELLOW, Text); return 0; } } return 0; } if(RPChat) { if(Inloggad[playerid] == 0) { return 0; } GetPlayerName(playerid, sendername, sizeof(sendername)); format(Text, sizeof(Text), "%s Says: %s", sendername, text); DistanceDetector(20.0, playerid, Text,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); return 0; } return 1; }
Код:
if(number == 123) { if(Mecs == 0) { SCM(playerid, COLOR_YELLOW, "Mechanic Central Says: Sorry we got no mechanics on duty right now!"); SCM(playerid, COLOR_YELLOW, "They Hung Up..."); Mobile[playerid] = 255; SetTimerEx("StopPhone", 1000, 0, "i", playerid); return 1; } SCM(playerid, COLOR_YELLOW, "Mechanic Central Says: Hello , What's your current position?"); Mobile[playerid] = 123; } for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerAtom[i][pPhone] == number && number != 0) { giveplayerid = i; Mobile[playerid] = giveplayerid; //Connecting if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(Mobile[giveplayerid] == 255) { format(Text,sizeof(Text), "** Your cell phone starts to ring! || Caller ID : %s **", UserName); SCM(giveplayerid, COLOR_YELLOW, Text); SCM(giveplayerid, COLOR_WHITE, "Use /Pickup to answear!"); GetPlayerName(giveplayerid, UserName2, sizeof(UserName2)); format(Text, sizeof(Text), "%s's Phone starts to ring", UserName2); DistanceDetector(20.0, i, Text, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); return 1; }