_iLustcheR_

TeleportsSystem v1.0

Jun 17th, 2013
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.75 KB | None | 0 0
  1. // TeleportsSystem v0.1 by LustcheR - Itzhak
  2.  
  3. #include <a_samp>
  4.  
  5. #if defined FILTERSCRIPT
  6.  
  7. #else
  8. #endif
  9.  
  10. public OnPlayerConnect(playerid)
  11. {
  12.     SendClientMessage(playerid, 0xFF0000AA, "[TeleportsSystem] >> {FFFFFF}LustcheR - בשרת זה קיימת מערכת שיגורים מתקדמת שנבנתה על ידי יצחק");
  13.     return 1;
  14. }
  15.  
  16. public OnPlayerCommandText(playerid, cmdtext[])
  17. {
  18.     new cmd[256], idx;
  19.     cmd = strtok(cmdtext,idx);
  20.    
  21.     if(!strcmp(cmd, "/T", true) || !strcmp(cmd, "/Teles", true) || !strcmp(cmd, "/Teleports", true)) return ShowPlayerDialog(playerid, 499, DIALOG_STYLE_LIST, "{FFFF00}TeleportsList", "LS - Los Santos\nLV - Las Venturas\nSF - San Fierro\nRace - אזור המירוצים\nAp - שדה התעופה\nTower - המגדל הגבוה", "יציאה", "השתגר");
  22.     if(!strcmp(cmd, "/LS", true)) return Teleport(playerid, 2513.0598, -1679.3516, 13.4944, 0x16EB43FF, "! LS ברוך הבא לעיר");
  23.     if(!strcmp(cmd, "/LV", true)) return Teleport(playerid, 2194.4668, 1834.6329, 10.8203, 0x16EB43FF, "! LV ברוך הבא לעיר");
  24.     if(!strcmp(cmd, "/SF", true)) return Teleport(playerid, -1915.1428, 883.2789, 35.4141, 0x16EB43FF, "! SF ברוך הבא לעיר");
  25.     if(!strcmp(cmd, "/Race", true)) return Teleport(playerid, -2583.3843, 1089.5833, 56.8863, 0x16EB43FF, "! Race ברוך הבא לאזור המירוצים");
  26.     if(!strcmp(cmd, "/Ap", true)) return Teleport(playerid, -1360.6449, -245.7484, 14.1440, 0x16EB43FF, "! Ap ברוך הבא לשדה התעופה");
  27.     if(!strcmp(cmd, "/Tower", true)) return Teleport(playerid, 1540.6641, -1366.8983, 329.7969, 0x16EB43FF, "! Tower ברוך הבא למגדל הגבוה");
  28.     return 0;
  29. }
  30.  
  31. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  32. {
  33.     if(dialogid == 499 && response)
  34.     {
  35.         switch(listitem)
  36.         {
  37.             case 0: OnPlayerCommandText(playerid,"/LS");
  38.             case 1: OnPlayerCommandText(playerid,"/LV");
  39.             case 2: OnPlayerCommandText(playerid,"/SF");
  40.             case 3: OnPlayerCommandText(playerid,"/Race");
  41.             case 4: OnPlayerCommandText(playerid,"/Ap");
  42.             case 5: OnPlayerCommandText(playerid,"/Tower");
  43.         }
  44.     }
  45.     return 1;
  46. }
  47.  
  48. stock Teleport(playerid,Float:x,Float:y,Float:z,Color,Message[])
  49. {
  50.     SetPlayerPos(playerid, x, y, z);
  51.     SendClientMessage(playerid, Color, Message);
  52.     return 1;
  53. }
  54.  
  55. stock strtok(const string[], &index)
  56. {
  57.     new length = strlen(string);
  58.     while ((index < length) && (string[index] <= ' '))
  59.     {
  60.         index++;
  61.     }
  62.     new offset = index;
  63.     new result[20];
  64.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  65.     {
  66.         result[index - offset] = string[index];
  67.         index++;
  68.     }
  69.     result[index - offset] = EOS;
  70.     return result;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment