Can you help me with /speed command (+REP)
#4

Quote:
Originally Posted by Daveosss
Посмотреть сообщение
This will show all the nearby players who are driving a vehicle and their speed:

PHP код:
stock GetPlayerSpeed(playerid)
{
    new 
Float:xx,Float:yy,Float:zz,Float:speed;
    if(
IsPlayerInAnyVehicle(playerid))
    {
        
GetVehicleVelocity(GetPlayerVehicleID(playerid),xx,yy,zz);
    }
    else
    {
        
GetPlayerVelocity(playerid,xx,yy,zz);
    }
    
speed floatsqroot((xx xx) + (yy yy) + (zz zz));
    return 
floatround((speed 165.12));
}
CMD:speed(playeridparams[]) // I'm using zcmd include here
{
    new 
found 0;
    new 
Float:X,Float:Y,Float:Z;
    
GetPlayerPos(playeridX,Y,Z);
    for(new 
0GetPlayerPoolSize(); <= ji++)
    {
        if(
IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER && IsPlayerInRangeOfPoint(i50.0XYZ) && != playerid)
        {
            
found 1;
            new 
string[128];
            new 
name[MAX_PLAYER_NAME];
            
GetPlayerName(playeridnamesizeof(name));
            
format(stringsizeof(string), "Player: %s(%d), Speed: %d"nameiGetPlayerSpeed(i));
            
SendClientMessage(playerid, -1string);
        }
    }
    if(
found == 0)
    {
        
SendClientMessage(playerid, -1"No players found.");
    }
    return 
1;

You should've read the above post. This isn't helping him at all, it's simply giving him code. It doesn't even have comments in the code. How does this help him learn anything?
Reply


Messages In This Thread
Can you help me with /speed command (+REP) - by BluePlayBG - 17.01.2018, 15:40
Re: Can you help me with /speed command (+REP) - by Dayrion - 17.01.2018, 15:57
Re: Can you help me with /speed command (+REP) - by Daveosss - 17.01.2018, 16:42
Re: Can you help me with /speed command (+REP) - by Abagail - 17.01.2018, 21:23

Forum Jump:


Users browsing this thread: 3 Guest(s)