toribio

toribio

Oct 7th, 2008
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.88 KB | None | 0 0
  1. //topo:
  2. new Float:gpos[100][4];
  3.  
  4. //OnPlayerCommandText:
  5.     if(!strcmp(cmd, "/marcar", true) && IsPlayerAdmin(playerid))
  6.     {
  7.         new tmp[256];
  8.         tmp = strtok(cmdtext, idx);
  9.         new slot = strval(tmp);
  10.         if(!strlen(tmp))return SendClientMessage(playerid, 0xFFFFFFFAA, "USE: /marcar [slot]");
  11.         if(slot >= 1 && slot <= 100)
  12.         {
  13.             slot--;
  14.             new Float:x, Float:y, Float:z, Float:a;
  15.             if(IsPlayerInAnyVehicle(playerid))
  16.             {
  17.                 GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
  18.                 GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  19.             } else {
  20.                 GetPlayerPos(playerid, x, y, z);
  21.                 GetPlayerFacingAngle(playerid, a);
  22.             }
  23.             gpos[slot][0] = x;
  24.             gpos[slot][1] = y;
  25.             gpos[slot][2] = z;
  26.             gpos[slot][3] = a;
  27.             SendClientMessage(playerid, 0xFFFFFFAA, "Salvo.");
  28.         } else {
  29.             SendClientMessage(playerid, 0xFFFFFFAA, "Slot inv�lido (1~100).");
  30.         }
  31.         return 1;
  32.     }
  33.  
  34.     if(!strcmp(cmd, "/evento", true))
  35.     {
  36.         new tmp[256];
  37.         tmp = strtok(cmdtext, idx);
  38.         new slot = strval(tmp);
  39.         if(!strlen(tmp))return SendClientMessage(playerid, 0xFFFFFFFAA, "USE: /evento [n�mero]");
  40.         if(slot >= 1 && slot <= 100)
  41.         {
  42.             slot--;
  43.             if(gpos[slot][0] != 0.0 && gpos[slot][1] != 0.0)
  44.             {
  45.                 if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  46.                 {
  47.                     SetVehiclePos(GetPlayerVehicleID(playerid),
  48.                     gpos[slot][0],
  49.                     gpos[slot][1],
  50.                     gpos[slot][2]);
  51.                     SetVehicleZAngle(GetPlayerVehicleID(playerid), gpos[slot][3]);
  52.                 } else {
  53.                     SetPlayerPos(playerid,
  54.                     gpos[slot][0],
  55.                     gpos[slot][1],
  56.                     gpos[slot][2]);
  57.                     SetPlayerFacingAngle(playerid, gpos[slot][3]);
  58.                 }
  59.                 SendClientMessage(playerid, 0xFFFFFFAA, "Teleportado.");
  60.             } else {
  61.                 SendClientMessage(playerid, 0xFFFFFFAA, "Evento vazio!");
  62.             }
  63.         } else {
  64.             SendClientMessage(playerid, 0xFFFFFFAA, "Evento inv�lido (1~100).");
  65.         }
  66.         return 1;
  67.     }
Add Comment
Please, Sign In to add comment