new Float:PosX[MAX_PLAYERS], Float:PosY[MAX_PLAYERS], Float:PosZ[MAX_PLAYERS], Float:PosA[MAX_PLAYERS], PosI[MAX_PLAYERS];
new bool: EnCoche[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[]){
if (strcmp("/sp", cmdtext, true, 10) == 0){
GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
GetPlayerFacingAngle(playerid, PosA[playerid]);
SendClientMessage(playerid, 0x57E427AA, "[INFO]: Sua posiзгo foi salva, para voltar use: /irp");
PosI[playerid] = (GetPlayerInterior(playerid));
PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0);
return 1;
}
if (strcmp("/irp", cmdtext, true, 10) == 0){
if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
{
SendClientMessage(playerid, 0xF60000AA, "[ERRO] Vocк nгo tem nenhuma posiзгo salva.");
}
else
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
SetCameraBehindPlayer(playerid);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), PosI[playerid]);
}
else
{
EnCoche[playerid] = false;
SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
SetPlayerFacingAngle(playerid, PosA[playerid]);
SetCameraBehindPlayer(playerid);
}
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
SetPlayerInterior(playerid, PosI[playerid]);
SendClientMessage(playerid, 0x008040FF, "Vocк se teleportou para a ultima posiзгo salva.");
}
return 1;
}
return 1;}
бrea errada І
posta na бrea correta, que irei fazer um exemplo muito mais fбcil.. |
Cara, nгo irei lhe criticar, sу irei apenas mostrar um modo mais fбcil!
posta na бrea certa.. |
new Float:SalvarX, Float:SalvarY, Float:SalvarZ, Float:SalvarAngulo;
stock SalvarLocal(playerid)
{
GetPlayerPos(playerid, SalvarX, SalvarY, SalvarZ);
GetPlayerFacingAngle(playerid, Float:SalvarAngulo);
return true;
}
stock IrLocal(playerid)
{
SetPlayerPos(playerid, SalvarX, SalvarY, SalvarZ);
SetPlayerFacingAngle(playerid, Float:SalvarAngulo);
return true;
}
Vlw, so noob neste forum samp '-'
Mas com o tempo eu me acustumo |
mano acho que vou me matar, pq ninguem le a ***** das regras?
|