Compas
#1

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?
Reply
#2

you can get the player roation with GetPlayerFacingAngle . then just make a nice textdraw that shows your direction :P
Reply
#3

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 ;
}
Reply
#4

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.
Reply
#5

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;
}
Reply
#6

you can define a callback in this way (not the way you do):
pawn Код:
public NAME(parameters)
also your warning means that you have multiple times 'new string' defined, you need to change string to some other variable name.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)