Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-------------------------------------------------
- #include <a_samp>
- //-------------------------------------------------
- // kTaxi Script by Kammer
- //-------------------------------------------------
- cmds_strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- //-------------------------------------------------
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- new idx;
- cmd = cmds_strtok(cmdtext, idx);
- if(strcmp(cmd, "/taxion", true) == 0)
- {
- SetPVarInt(playerid, "taxi", 1);
- SetPVarInt(playerid, "tax1", CreateObject(19311,0,0,0,0,0,0));
- SetPVarInt(playerid, "tax2", CreateObject(19311,0,0,0,0,0,0));
- SetPVarInt(playerid, "tax3", CreateObject(19311,0,0,0,0,0,0));
- SetPVarInt(playerid, "tax4", CreateObject(19311,0,0,0,0,0,0));
- AttachObjectToVehicle(GetPVarInt(playerid, "tax1"), GetPlayerVehicleID(playerid), 0.034999, 2.600012, -0.169999, 0.000000, 5.024998, 88.439956);
- AttachObjectToVehicle(GetPVarInt(playerid, "tax2"), GetPlayerVehicleID(playerid), 1.024999, 0.679999, -0.279999, 1.004999, 3.014998, 177.885086);
- AttachObjectToVehicle(GetPVarInt(playerid, "tax3"), GetPlayerVehicleID(playerid), -0.989999, 0.684999, -0.279999, 1.004999, 3.014998, 177.885086);
- AttachObjectToVehicle(GetPVarInt(playerid, "tax4"), GetPlayerVehicleID(playerid), 0.010000, -2.320005, -0.284999, 1.004999, 3.014998, 268.335510);
- GameTextForPlayer(playerid, "~g~~h~ Your Taxi is on duty!",3000,5);
- return 1;
- }
- if(strcmp(cmd, "/taxioff",true) == 0)
- {
- DeletePVar(playerid, "taxi");
- DestroyObject(GetPVarInt(playerid, "tax1"));
- DestroyObject(GetPVarInt(playerid, "tax2"));
- DestroyObject(GetPVarInt(playerid, "tax3"));
- DestroyObject(GetPVarInt(playerid, "tax4"));
- GameTextForPlayer(playerid, "~r~~h~ Now , Your Taxi is off duty!",3000,5);
- return 1;
- }
- return 0;
- }
- // EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement