Advertisement
IceNight

Untitled

Aug 20th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.20 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Gate[3];
  4.  
  5. main(){}
  6.  
  7. public OnFilterScriptInit()
  8. {
  9.     CreateObject(8342, -2635.693604, 408.902588, 6.436961, 0.0000, 0.0000, 270.0000);
  10.     CreateObject(8342, -2795.771240, 317.442383, 6.676289, 0.0000, 0.0000, 90.0000);
  11.     CreateObject(8342, -2646.250244, 300.686310, 5.978977, 0.0000, 0.0000, 180.0000);
  12.     CreateObject(3749, -2706.373047, 310.289703, 9.038102, 0.0000, 0.0000, 0.0000);
  13.     CreateObject(8210, -2775.129395, 417.129730, 6.517241, 0.0000, 0.0000, 90.0000);
  14.     CreateObject(8210, -2747.074951, 445.095306, 6.499427, 0.0000, 0.0000, 0.0000);
  15.     CreateObject(8947, -2706.369629, 438.981323, 6.232468, 0.0000, 0.0000, 0.0000);
  16.     CreateObject(8210, -2706.895508, 452.507446, 6.280714, 0.0000, 0.0000, 0.0000);
  17.  
  18.     Gate[0] = CreateObject(1696, -2769.541992, 362.125305, 3.211641, 341.0924, 0.0000, 270.0000);
  19.     Gate[1] = CreateObject(969, -2701.869873, 426.920776, 3.346565, 0.0000, 0.0000, 180.0000);
  20.     Gate[2] = CreateObject(980, -2706.330811, 310.208038, 5.953079, 0.0000, 0.0000, 180.0000);
  21.     return 0;
  22. }
  23.  
  24. public OnPlayerCommandText(playerid, cmdtext[])
  25. {
  26.     new cmd[256],idx;
  27.     cmd = strtok(cmdtext,idx);
  28.    
  29.     if(!strcmp(cmd, "/LOG", true))
  30.     {
  31.         cmd = strtok(cmdtext,idx);
  32.         switch(strval(cmd))
  33.         {
  34.             case 1: MoveObject(Gate[0], -2769.5420, 362.1253, 26.1424, 2.5);
  35.             case 2: MoveObject(Gate[1], -2701.8674, 426.9406, -0.0200, 2.5);
  36.             case 3: MoveObject(Gate[2], -2706.3308, 310.2080, 0.3931, 2.5);
  37.         }
  38.         return 1;
  39.     }
  40.     if(!strcmp(cmd, "/LCG", true))
  41.     {
  42.         cmd = strtok(cmdtext,idx);
  43.         switch(strval(cmd))
  44.         {
  45.             case 1: MoveObject(Gate[0], -2769.541992, 362.125305, 3.211641, 2.5);
  46.             case 2: MoveObject(Gate[1], -2701.869873, 426.920776, 3.346565, 2.5);
  47.             case 3: MoveObject(Gate[2], -2706.330811, 310.208038, 5.953079, 2.5);
  48.         }
  49.         return 1;
  50.     }
  51.     return 0;
  52. }
  53.  
  54. stock strtok(const string[], &index,seperator=' ')
  55. {
  56.     new length = strlen(string),offset = index,result[256];
  57.     while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
  58.     {
  59.         result[index - offset] = string[index];
  60.         index++;
  61.     }
  62.     result[index - offset] = EOS;
  63.     if ((index < length) && (string[index] == seperator))
  64.     {
  65.         index++;
  66.     }
  67.     return result;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement