Advertisement
Guest User

kTaxi

a guest
Oct 24th, 2011
747
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.23 KB | None | 0 0
  1. //-------------------------------------------------
  2.  
  3.  
  4. #include <a_samp>
  5.  
  6.  
  7. //-------------------------------------------------
  8. // kTaxi Script by Kammer
  9. //-------------------------------------------------
  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.  
  31.  
  32.  
  33.  
  34. //-------------------------------------------------
  35.  
  36. public OnPlayerCommandText(playerid, cmdtext[])
  37. {
  38.     new cmd[256];
  39.     new idx;
  40.    
  41.     cmd = cmds_strtok(cmdtext, idx);
  42.  
  43.  
  44.     if(strcmp(cmd, "/taxion", true) == 0)
  45.     {
  46.       SetPVarInt(playerid, "taxi", 1);
  47.       SetPVarInt(playerid, "tax1", CreateObject(19311,0,0,0,0,0,0));
  48.       SetPVarInt(playerid, "tax2", CreateObject(19311,0,0,0,0,0,0));
  49.       SetPVarInt(playerid, "tax3", CreateObject(19311,0,0,0,0,0,0));
  50.       SetPVarInt(playerid, "tax4", CreateObject(19311,0,0,0,0,0,0));
  51.       AttachObjectToVehicle(GetPVarInt(playerid, "tax1"), GetPlayerVehicleID(playerid), 0.034999, 2.600012, -0.169999, 0.000000, 5.024998, 88.439956);
  52.       AttachObjectToVehicle(GetPVarInt(playerid, "tax2"), GetPlayerVehicleID(playerid), 1.024999, 0.679999, -0.279999, 1.004999, 3.014998, 177.885086);
  53.       AttachObjectToVehicle(GetPVarInt(playerid, "tax3"), GetPlayerVehicleID(playerid), -0.989999, 0.684999, -0.279999, 1.004999, 3.014998, 177.885086);
  54.       AttachObjectToVehicle(GetPVarInt(playerid, "tax4"), GetPlayerVehicleID(playerid), 0.010000, -2.320005, -0.284999, 1.004999, 3.014998, 268.335510);
  55.       GameTextForPlayer(playerid, "~g~~h~ Your Taxi is on duty!",3000,5);
  56.       return 1;
  57.  
  58.     }
  59.     if(strcmp(cmd, "/taxioff",true) == 0)
  60.     {
  61.      DeletePVar(playerid, "taxi");
  62.      DestroyObject(GetPVarInt(playerid, "tax1"));
  63.      DestroyObject(GetPVarInt(playerid, "tax2"));
  64.      DestroyObject(GetPVarInt(playerid, "tax3"));
  65.      DestroyObject(GetPVarInt(playerid, "tax4"));
  66.      GameTextForPlayer(playerid, "~r~~h~ Now , Your Taxi is off duty!",3000,5);
  67.      return 1;
  68.     }
  69.     return 0;
  70. }
  71.  
  72. // EOF
  73.  
  74.  
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement