#1

So, i am editing my goto command, right now admins who is in a vehicle can't use it, but i'll make it so they can,

but first, i want to check if the player they want go to is in a interior, if they are, they will get a message there it says "this player is in a interior, you cannot go to him"


pawn Код:
new Float:x, Float:y, Float:z;
    if(IsPlayerInAnyVehicle(playerid)) {
        GetPlayerPos(pID, x, y, z);
        SetPlayerInterior(playerid, GetPlayerInterior(pID));
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pID));
        SetVehiclePos(GetPlayerVehicleID(playerid), x+2, y+2, z);
    }
    else
    {
        GetPlayerPos(pID, x, y, z);
        SetPlayerInterior(playerid, GetPlayerInterior(pID));
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pID));
        SetPlayerPos(playerid, x+2, y+2, z);
    }
Reply
#2

pawn Код:
new Float:x, Float:y, Float:z;
    if(IsPlayerInAnyVehicle(playerid)) {
        GetPlayerPos(pID, x, y, z);
        SetPlayerInterior(playerid, GetPlayerInterior(pID));
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pID));
        SetVehiclePos(GetPlayerVehicleID(playerid), x+2, y+2, z);
    }
    else
    {
        GetPlayerPos(pID, x, y, z);
        SetPlayerInterior(playerid, GetPlayerInterior(pID));
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pID));
        SetPlayerPos(playerid, x+2, y+2, z);
    }
    if(GetPlayerInterior(pID) > 0)
    {
        SendCilentMessage(playerid,COLOR,"You cannot go to this player because he is in interior.");
        return 1;
     }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)