Boost level
#1

Hello
I don't know whats the problem?
If I type /blevel 2 it blows me away like feather in thunder. WHY
But I have got this line under onplayerconnect setted to 2
Код:
PlayerInfo[playerid][Boostlevel] = 2;
Command:
Код:
CMD:blevel(playerid,params[])
{
#pragma unused params
new level;
if(sscanf(params, "u", level)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /blevel [0.0-10.0]");
PlayerInfo[playerid][Boostlevel] = params[0];
return 1;
}
And I have got this line under onplayerkeystatechange
Код:
if(newkeys & KEY_SUBMISSION)
{
if(PlayerInfo[playerid][Boost] == 1)
{
new Float:vx,Float:vy,Float:vz;
GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * PlayerInfo[playerid][Boostlevel], vy *PlayerInfo[playerid][Boostlevel], vz * PlayerInfo[playerid][Boostlevel]);
}
}
}
Reply
#2

Try something lower like 1.1 and see what happens.
Reply
#3

if(sscanf(params, "u", level))

"u" is the parameter for playerids.

i = integer
d = decimal

so
Код:
if(sscanf(params, "d", level))
Will work properly.
Reply
#4

Now it works thanks

But how to make that player could enter like 10.0 (that it wont say /blevel [0.0-10.0])?

Code

Код:
CMD:blevel(playerid,params[])
{
#pragma unused params
new level;
if(sscanf(params, "d", level)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /blevel [0.0-10.0]");
PlayerInfo[playerid][Boostlevel] = level;
return 1;
}
Reply
#5

pawn Код:
CMD:blevel(playerid,params[])
{
    new Float:level;
    if(sscanf(params, "f", level)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /blevel [0.0-10.0]");
    PlayerInfo[playerid][Boostlevel] = level;
    return 1;
}
You will need to change 'Boostlevel' in your enum to 'Float:Boostlevel'.
Reply
#6

Thanks
Reply
#7

But it blows me away as feather again if I use "f"
Reply
#8

Then the boost level is too high.
Reply
#9

nope I give it 1.8 and the same even 0.1
Reply
#10

That's 180% as fast as you were going. Try something smaller.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)