15.11.2011, 20:04
Hey.. I made a speedometer by using of the guides in the forums I found..
Since I have a problem with my router and my ports arent opened for some reason.. I gave the script to a friend so he'll help me check few things so when I was on his server I couldnt see the speedometer I made.. but he could see it
and on my own server I can see it..
anyway.. I'll show here exactly what I did..
public OnPlayerConnect(playerid)
public OnGameModeInit()
btw.. ignore the FUELOS its same things done just for the fuel.. but ignore it please
anyway.. what is wrong here? I mean.. nothing wrong I took it from guide and everything working good.. I just couldnt see it in my friend's server.. but he could see it!
maybe only the server owner can see? anyway.. no idea!
PLEASE HELP
Since I have a problem with my router and my ports arent opened for some reason.. I gave the script to a friend so he'll help me check few things so when I was on his server I couldnt see the speedometer I made.. but he could see it
and on my own server I can see it..
anyway.. I'll show here exactly what I did..
pawn Код:
forward Speedometer(playerid);
pawn Код:
new Text:SPEEDOS[MAX_PLAYERS];
pawn Код:
SPEEDOS[playerid] = TextDrawCreate(10.0,200.0," ");
TextDrawShowForPlayer(playerid,SPEEDOS[playerid]);
pawn Код:
SetTimer("Speedometer", 100, true);
pawn Код:
public Speedometer(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int;
vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid != 0)
{
GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*250.666667; // 250.666667 = kmph // 199,4166672 = mph
final_speed_int = floatround(final_speed,floatround_round);
format(speed_string,256,"Speed (km/h): %i",final_speed_int);
TextDrawSetString(SPEEDOS[playerid], speed_string);
}
}
else
{
TextDrawSetString(FUELOS[playerid], " ");
TextDrawSetString(SPEEDOS[playerid], " ");
}
return 1;
}
anyway.. what is wrong here? I mean.. nothing wrong I took it from guide and everything working good.. I just couldnt see it in my friend's server.. but he could see it!
maybe only the server owner can see? anyway.. no idea!
PLEASE HELP

