15.11.2011, 00:35
fiz uma fs com esse codigo
#include <a_samp>
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("/s", 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: /i");
PosI[playerid] = (GetPlayerInterior(playerid));
PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0);
return 1;
}
if (strcmp("/i", cmdtext, true, 10) == 0){
if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
{
SendClientMessage(playerid, 0xF60000AA, "[ERRO] Vocк nгo tem nenhuma posiзгo salva use /s para salvar uma.");
}
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;
}
so q quando ponho ele para funcionar os comando da minha gm para de funcionar teleportes etc
oq altero no codigo para q funcione com a gm
#include <a_samp>
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("/s", 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: /i");
PosI[playerid] = (GetPlayerInterior(playerid));
PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0);
return 1;
}
if (strcmp("/i", cmdtext, true, 10) == 0){
if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
{
SendClientMessage(playerid, 0xF60000AA, "[ERRO] Vocк nгo tem nenhuma posiзгo salva use /s para salvar uma.");
}
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;
}
so q quando ponho ele para funcionar os comando da minha gm para de funcionar teleportes etc
oq altero no codigo para q funcione com a gm