Compas - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Compas (
/showthread.php?tid=259793)
Compas -
cruising - 06.06.2011
Hello!
I have been searching for a compass but have not found one.
so does anyone know where to get one? or help me how to create on?
Re: Compas -
Gamer_Z - 06.06.2011
you can get the player roation with GetPlayerFacingAngle . then just make a nice textdraw that shows your direction :P
Re: Compas -
cruising - 06.06.2011
Quote:
Originally Posted by gamer_Z
you can get the player roation with GetPlayerFacingAngle . then just make a nice textdraw that shows your direction :P
|
text draws are way to hard for me
And i was looking on wiki and found this
pawn Код:
new Float:Angle, string[26];
GetPlayerFacingAngle(playerid, Angle);
format(string, sizeof(string), "Your facing angle: %0.2f", Angle);
SendClientMessage(playerid, 0xFFFFFFFF, string);
should it be like this os something?
pawn Код:
public(playerid,Float:Angle)
{
new Float:Angle, string[26];
format(string, sizeof(string), "Your facing angle: %0.2f", Angle);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return ;
}
Re: Compas -
Gamer_Z - 06.06.2011
Quote:
Originally Posted by cruising
text draws are way to hard for me
And i was looking on wiki and found this
pawn Код:
new Float:Angle, string[26]; GetPlayerFacingAngle(playerid, Angle); format(string, sizeof(string), "Your facing angle: %0.2f", Angle); SendClientMessage(playerid, 0xFFFFFFFF, string);
should it be like this os something?
pawn Код:
public(playerid,Float:Angle) { new Float:Angle, string[26]; format(string, sizeof(string), "Your facing angle: %0.2f", Angle); SendClientMessage(playerid, 0xFFFFFFFF, string); return ; }
|
pawn Код:
new Float:Angle, string[26];
GetPlayerFacingAngle(playerid, Angle);
format(string, sizeof(string), "Your facing angle: %0.2f", Angle);
SendClientMessage(playerid, 0xFFFFFFFF, string);
>>
pawn Код:
new Float:Angle, string[26];
GetPlayerFacingAngle(playerid, Angle);
format(string, sizeof(string), "Direction: %0.0f grades", Angle);
TextDrawSetString(TextDrawID,string);
try that :P
Check out some TD tutorials before you go on.
Re: Compas -
cruising - 06.06.2011
Quote:
Originally Posted by gamer_Z
pawn Код:
new Float:Angle, string[26]; GetPlayerFacingAngle(playerid, Angle); format(string, sizeof(string), "Your facing angle: %0.2f", Angle); SendClientMessage(playerid, 0xFFFFFFFF, string);
>>
pawn Код:
new Float:Angle, string[26]; GetPlayerFacingAngle(playerid, Angle); format(string, sizeof(string), "Direction: %0.0f grades", Angle); TextDrawSetString(TextDrawID,string);
try that :P
Check out some TD tutorials before you go on.
|
I get plenty of
pawn Код:
warning 219: local variable "string" shadows a variable at a preceding level
and i have this code (dont know if i need some more then a text draw?)
pawn Код:
public(playerid,Float:Angle)
{
new Float:Angle, string[26];
GetPlayerFacingAngle(playerid, Angle);
format(string, sizeof(string), "Direction: %0.0f grades", Angle);
TextDrawSetString(TextDrawID,string);
return 1;
}
Re: Compas -
Gamer_Z - 06.06.2011
you can define a callback in this way (not the way you do):
also your warning means that you have multiple times 'new string' defined, you need to change string to some other variable name.