Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!strcmp(cmd, "/salvar", true))
- {
- new tmp[256], comment[256], pname[24], string[256], File:file;
- tmp = strtok(cmdtext, idx);
- comment = tmp;
- while(strlen(tmp) > 0)
- {
- strcat(comment, " ");
- strcat(comment, tmp);
- tmp = strtok(cmdtext,idx);
- }
- GetPlayerName(playerid, pname, sizeof pname);
- if(!IsPlayerInAnyVehicle(playerid))
- {
- new Float:x, Float:y, Float:z, Float:a;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, a);
- if(strlen(tmp))
- {
- format(string, sizeof string, "AddPlayerClass(%d, %.4f, %.4f, %.4f, %.4f, 0, \
- 0, 0, 0, 0, 0); //%s: %s", GetPlayerSkin(playerid), x, y, z, a, pname, comment);
- } else {
- format(string, sizeof string, "AddPlayerClass(%d, %.4f, %.4f, %.4f, %.4f, 0, \
- 0, 0, 0, 0, 0); //%s", GetPlayerSkin(playerid), x, y, z, a, pname);
- }
- } else {
- new Float:x, Float:y, Float:z, Float:a;
- GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- if(strlen(tmp))
- {
- format(string, sizeof string, "AddStaticVehicle(%d, %.4f, %.4f, %.4f, %.4f, -1, \
- -1); //%s: %s", GetVehicleModel(GetPlayerVehicleID(playerid)), x, y, z, a, pname, comment);
- } else {
- format(string, sizeof string, "AddStaticVehicle(%d, %.4f, %.4f, %.4f, %.4f, -1, \
- -1); //%s", GetVehicleModel(GetPlayerVehicleID(playerid)), x, y, z, a, pname);
- }
- }
- SendClientMessage(playerid, 0xFFFFFFAA, string);
- strcat(string, "\n");
- file = fopen("savedpositions.txt", io_write);
- fwrite(file, string);
- fclose(file);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment