Janchuks

[v0,3]Sultan Taxi

Feb 6th, 2013
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.29 KB | None | 0 0
  1. // ______ _                 _                   ______
  2. //| ___ \ |               | |                 |___  /
  3. //| |_/ / |__   __ _ _ __ | |_ ___  _ __ ___     / /
  4. //|  __/| '_ \ / _` | '_ \| __/ _ \| '_ ` _ \   / /
  5. //| |   | | | | (_| | | | | || (_) | | | | | |./ /___
  6. //\_|   |_| |_|\__,_|_| |_|\__\___/|_| |_| |_|\_____/
  7.  
  8.  
  9. #include <a_samp>
  10.  
  11. cmds_strtok(const string[], &index)
  12. {
  13.     new length = strlen(string);
  14.     while ((index < length) && (string[index] <= ' '))
  15.     {
  16.         index++;
  17.     }
  18.  
  19.     new offset = index;
  20.     new result[20];
  21.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  22.     {
  23.         result[index - offset] = string[index];
  24.         index++;
  25.     }
  26.     result[index - offset] = EOS;
  27.     return result;
  28. }
  29.  
  30. public OnPlayerCommandText(playerid, cmdtext[])
  31. {
  32.     new cmd[256];
  33.     new idx;
  34.    
  35.     cmd = cmds_strtok(cmdtext, idx);
  36.  
  37.  
  38.     if(strcmp(cmd, "/fareon", true) == 0)
  39.     {
  40.       SetPVarInt(playerid, "taxi", 1);
  41.       SetPVarInt(playerid, "tax1", CreateObject(19311,0,0,0,0,0,0));
  42.       SetPVarInt(playerid, "tax2", CreateObject(19311,0,0,0,0,0,0));
  43.       SetPVarInt(playerid, "tax3", CreateObject(19311,0,0,0,0,0,0));
  44.       SetPVarInt(playerid, "tax4", CreateObject(19311,0,0,0,0,0,0));
  45.       AttachObjectToVehicle(GetPVarInt(playerid, "tax1"), GetPlayerVehicleID(playerid), 0.034999, 2.600012, -0.169999, 0.000000, 5.024998, 88.439956);
  46.       AttachObjectToVehicle(GetPVarInt(playerid, "tax2"), GetPlayerVehicleID(playerid), 1.024999, 0.679999, -0.279999, 1.004999, 3.014998, 177.885086);
  47.       AttachObjectToVehicle(GetPVarInt(playerid, "tax3"), GetPlayerVehicleID(playerid), -0.989999, 0.684999, -0.279999, 1.004999, 3.014998, 177.885086);
  48.       AttachObjectToVehicle(GetPVarInt(playerid, "tax4"), GetPlayerVehicleID(playerid), 0.010000, -2.320005, -0.284999, 1.004999, 3.014998, 268.335510);
  49.       SendClientMessage(playerid, "~g~~h~ Your Taxi is on duty!",3000,5);
  50.       return 1;
  51.  
  52.     }
  53.     if(strcmp(cmd, "/fareoff",true) == 0)
  54.     {
  55.      DeletePVar(playerid, "taxi");
  56.      DestroyObject(GetPVarInt(playerid, "tax1"));
  57.      DestroyObject(GetPVarInt(playerid, "tax2"));
  58.      DestroyObject(GetPVarInt(playerid, "tax3"));
  59.      DestroyObject(GetPVarInt(playerid, "tax4"));
  60.      SendClientMessage(playerid, "~r~~h~ Now , Your Taxi is off duty!",3000,5);
  61.      return 1;
  62.     }
  63.     return 0;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment