error 017: undefined symbol "GetXYInFrontOfPlayer" - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 017: undefined symbol "GetXYInFrontOfPlayer" (
/showthread.php?tid=451708)
error 017: undefined symbol "GetXYInFrontOfPlayer" -
JayceonTaylor - 18.07.2013
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 ?
Re: error 017: undefined symbol "GetXYInFrontOfPlayer" -
TheOnlyRealFuzzy - 18.07.2013
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));
}
Re : error 017: undefined symbol "GetXYInFrontOfPlayer" -
JayceonTaylor - 18.07.2013
Thanks bro
![Smiley](images/smilies/smile.png)
works