error 017: undefined symbol "GetXYInFrontOfPlayer"
#1

pawn Код:
CMD:createatm(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) {
        return SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You are not authorised to use that command");
    }

    new
        id = getNextAvailableATMID();

    GetPlayerPos(playerid, AtmInfo[id][atmX], AtmInfo[id][atmY], AtmInfo[id][atmZ]);
    GetPlayerFacingAngle(playerid, AtmInfo[id][atmAngle]);
    GetXYInFrontOfPlayer(playerid, AtmInfo[id][atmX], AtmInfo[id][atmY], 2.0);

    AtmInfo[id][atmTaken] = 1;
    AtmInfo[id][atmInterior] = GetPlayerInterior(playerid);
    AtmInfo[id][atmVirtualWorld] = GetPlayerVirtualWorld(playerid);
    AtmInfo[id][atmAngle] += 90;

    SendClientMessage(playerid, 0xFFFF00FF, "You have created an ATM.");

    CreateDynamicATM(id);
    return 1;
}
How can i fix that wrong ?
Reply
#2

Add this anywhere in your script

pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if (GetPlayerVehicleID(playerid))
    {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
Reply
#3

Thanks bro works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)