toribio

toribio

Sep 28th, 2008
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.62 KB | None | 0 0
  1.     if(!strcmp(cmd, "/salvar", true))
  2.     {
  3.         new tmp[256], comment[256], pname[24], string[256], File:file;
  4.         tmp = strtok(cmdtext, idx);
  5.         comment = tmp;
  6.         while(strlen(tmp) > 0)
  7.         {
  8.             strcat(comment, " ");
  9.             strcat(comment, tmp);
  10.             tmp = strtok(cmdtext,idx);
  11.         }
  12.         GetPlayerName(playerid, pname, sizeof pname);
  13.         if(!IsPlayerInAnyVehicle(playerid))
  14.         {
  15.             new Float:x, Float:y, Float:z, Float:a;
  16.             GetPlayerPos(playerid, x, y, z);
  17.             GetPlayerFacingAngle(playerid, a);
  18.             if(strlen(tmp))
  19.             {
  20.                 format(string, sizeof string, "AddPlayerClass(%d, %.4f, %.4f, %.4f, %.4f, 0, \
  21.                 0, 0, 0, 0, 0); //%s: %s", GetPlayerSkin(playerid), x, y, z, a, pname, comment);
  22.             } else {
  23.                 format(string, sizeof string, "AddPlayerClass(%d, %.4f, %.4f, %.4f, %.4f, 0, \
  24.                 0, 0, 0, 0, 0); //%s", GetPlayerSkin(playerid), x, y, z, a, pname);
  25.             }
  26.         } else {
  27.             new Float:x, Float:y, Float:z, Float:a;
  28.             GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
  29.             GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  30.             if(strlen(tmp))
  31.             {
  32.                 format(string, sizeof string, "AddStaticVehicle(%d, %.4f, %.4f, %.4f, %.4f, -1, \
  33.                 -1); //%s: %s", GetVehicleModel(GetPlayerVehicleID(playerid)), x, y, z, a, pname, comment);
  34.             } else {
  35.                 format(string, sizeof string, "AddStaticVehicle(%d, %.4f, %.4f, %.4f, %.4f, -1, \
  36.                 -1); //%s", GetVehicleModel(GetPlayerVehicleID(playerid)), x, y, z, a, pname);
  37.             }
  38.         }
  39.         SendClientMessage(playerid, 0xFFFFFFAA, string);
  40.         strcat(string, "\n");
  41.         file = fopen("savedpositions.txt", io_write);
  42.         fwrite(file, string);
  43.         fclose(file);
  44.         return 1;
  45.     }
Advertisement
Add Comment
Please, Sign In to add comment