Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new Float:pos[MAX_PLAYERS][100][4];
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- new idx;
- cmd = strtok(cmdtext, idx);
- if(!strcmp(cmd, "/salvar", true))
- {
- new tmp[256];
- tmp = strtok(cmdtext, idx);
- new slot = strval(tmp);
- if(!strlen(tmp))return SendClientMessage(playerid, 0xFFFFFFFAA, "USE: /salvar [slot]");
- if(slot >= 1 && slot <= 100)
- {
- slot--;
- new Float:x, Float:y, Float:z, Float:a;
- if(IsPlayerInAnyVehicle(playerid))
- {
- GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- pos[playerid][slot][0] = x;
- pos[playerid][slot][1] = y;
- pos[playerid][slot][2] = z;
- pos[playerid][slot][3] = a;
- } else {
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, a);
- pos[playerid][slot][0] = x;
- pos[playerid][slot][1] = y;
- pos[playerid][slot][2] = z;
- pos[playerid][slot][3] = a;
- }
- SendClientMessage(playerid, 0xFFFFFFAA, "Salvo.");
- } else {
- SendClientMessage(playerid, 0xFFFFFFAA, "Slot inv�lido (1~100).");
- }
- return 1;
- }
- if(!strcmp(cmd, "/ir", true))
- {
- new tmp[256];
- tmp = strtok(cmdtext, idx);
- new slot = strval(tmp);
- if(!strlen(tmp))return SendClientMessage(playerid, 0xFFFFFFFAA, "USE: /ir [slot]");
- if(slot >= 1 && slot <= 100)
- {
- slot--;
- if(pos[playerid][slot][0] != 0.0 && pos[playerid][slot][1] != 0.0)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),
- pos[playerid][slot][0],
- pos[playerid][slot][1],
- pos[playerid][slot][2]);
- SetVehicleZAngle(GetPlayerVehicleID(playerid), pos[playerid][slot][3]);
- } else {
- SetPlayerPos(playerid,
- pos[playerid][slot][0],
- pos[playerid][slot][1],
- pos[playerid][slot][2]);
- SetPlayerFacingAngle(playerid, pos[playerid][slot][3]);
- }
- SendClientMessage(playerid, 0xFFFFFFAA, "Teleportado.");
- } else {
- SendClientMessage(playerid, 0xFFFFFFAA, "Slot vazio!");
- }
- } else {
- SendClientMessage(playerid, 0xFFFFFFAA, "Slot inv�lido (1~100).");
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment