[+]: Vehicle Speed = + score not work.
#1

Problem solved.
Reply
#2

Like this ? Try it
PHP код:
#define PRESSING(%0,%1) \
    
(%& (%1))
// Top of Your Script
new final_speed[MAX_PLAYERS]; // Top of Your Script too
stock GetPlayerSpeed(playerid)
{
    new 
Float:x,Float:y,Float:z,Float:speed;
    
GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
    
speed floatsqroot(((x*x)+(y*y))+(z*z))*100;
    
final_speed[playerid floatround(speed,floatround_round);
    
    return 
final_speed[playerid];
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
IsPlayerInAnyVehicle)
    {
         if (
PRESSINGKEY_SPRINT  ))
        {
            if(
final_speed[playerid] > 0)
            {
                
SetPlayerScore(playeridGetPlayerScore(playerid) + 1);
            }
        }
    }
    return 
1;

Reply
#3

Quote:
Originally Posted by colonel-top
Посмотреть сообщение
Like this ? Try it
PHP код:
#define PRESSING(%0,%1) \
    
(%& (%1))
// Top of Your Script
new final_speed[MAX_PLAYERS]; // Top of Your Script too
stock GetPlayerSpeed(playerid)
{
    new 
Float:x,Float:y,Float:z,Float:speed;
    
GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
    
speed floatsqroot(((x*x)+(y*y))+(z*z))*100;
    
final_speed[playerid floatround(speed,floatround_round);
    
    return 
final_speed[playerid];
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
IsPlayerInAnyVehicle)
    {
         if (
PRESSINGKEY_SPRINT  ))
        {
            if(
final_speed[playerid] > 0)
            {
                
SetPlayerScore(playeridGetPlayerScore(playerid) + 1);
            }
        }
    }
    return 
1;

unfortunately, it did not work. detecting the speed vehicle (it reaches a certain speed of) contact i can not integrate score. :/
Reply
#4

EDIT :
PHP код:
#define PRESSING(%0,%1) \ 
    
(%& (%1)) 
// Top of Your Script 
new final_speed[MAX_PLAYERS]; // Top of Your Script too 
stock GetPlayerSpeed(playerid

    new 
Float:x,Float:y,Float:z,Float:speed
    
GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z); 
    
speed floatsqroot(((x*x)+(y*y))+(z*z))*100
    
final_speed[playerid floatround(speed,floatround_round); 
     
    return 
final_speed[playerid]; 

public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys

    if(
IsPlayerInAnyVehicle
    { 
         if (
PRESSINGKEY_SPRINT  )) 
        { 
            if(
final_speed[playerid] > ur_speed_value
            { 
                
SetPlayerScore(playeridGetPlayerScore(playerid) + 1); 
            } 
        } 
    } 
    return 
1

and give us error if have

PS. // I do not understood and confusing little bit :P
Reply
#5

This did code not work, problem is NOT solved.
Reply
#6

Quote:
Originally Posted by colonel-top
Посмотреть сообщение
EDIT :
PHP код:
#define PRESSING(%0,%1) \ 
    
(%& (%1)) 
// Top of Your Script 
new final_speed[MAX_PLAYERS]; // Top of Your Script too 
stock GetPlayerSpeed(playerid

    new 
Float:x,Float:y,Float:z,Float:speed
    
GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z); 
    
speed floatsqroot(((x*x)+(y*y))+(z*z))*100
    
final_speed[playerid floatround(speed,floatround_round); 
     
    return 
final_speed[playerid]; 

public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys

    if(
IsPlayerInAnyVehicle
    { 
         if (
PRESSINGKEY_SPRINT  )) 
        { 
            if(
final_speed[playerid] > ur_speed_value
            { 
                
SetPlayerScore(playeridGetPlayerScore(playerid) + 1); 
            } 
        } 
    } 
    return 
1

and give us error if have

PS. // I do not understood and confusing little bit :P
ur_speed_value not introduced ?
Reply
#7

it worked.
https://sampforum.blast.hk/showthread.php?tid=446853
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)