Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new NeedsTaxi[MAX_PLAYERS];
- new Float:GetLocX, Float:GetLocY, Float:GetLocZ;
- new WhoNeedsATaxi;
- new SomeOneNeedsATaxi;
- if(strcmp(cmdtext, "/taxi", true) == 0)
- {
- WhoNeedsATaxi = playerid;
- SomeOneNeedsATaxi = 1;
- NeedsTaxi[playerid] = 1; //the player needs the taxi
- GetPlayerPos(playerid,GetLocX,GetLocY,GetLocZ);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if (GetPlayerSkin(i) == 255)
- {
- new string[128];
- new pname[24];
- format(string, 128,"[TAXI]: %s needs taxi service. type /accept to do the job",pname);
- SendClientMessage(i,COLOR_GREEN,string);
- }
- }
- return 1;
- }
- if(strcmp(cmdtext, "/accept", true) == 0)
- {
- if (GetPlayerSkin(playerid) == 255)
- {
- if(SomeOneNeedsATaxi == 1)
- {
- WhoNeedsATaxi = 255;
- SomeOneNeedsATaxi = 0;
- new string[128];
- new pname[24];
- format(string, 128,"[TAXI]: %s has accepted your call and is on the way!",pname);
- SendClientMessage(WhoNeedsTaxi,COLOR_GREEN,string);
- SetPlayerCheckpoint(playerid,GetLocX,GetLocY,GetLocZ,2);
- GetLocX = 0; GetLocY = 0; GetLocZ = 0;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREEN, "No one called for a taxi");
- }
- }
- else
- {
- SendClientMessage(playerid,COLOR_LIGHTBLUE, "[!] You are not a taxi driver!");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment