[Help]Drifting system
#1

hey guys well, i want to make a drifting system for my server just for wen your in a car obviously, and i just cant get this, i can get the angle and display it, but how would i make it add "points" so like, say your angle is 100, your points is 100, then your angle changes to 200, then your points is 300 ect. i just don't know how i would go about doing this, please help iv'e got this from another help script just to test it out n stuff:

pawn Код:
#include <a_samp>
forward Drift(playerid,vehicleid);
new Drifting[MAX_PLAYERS];
new Float:nx,Float:ny;
new Float:tang;
new Float:ann;
new string[256];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Testing Drift System");
    print("--------------------------------------\n");
    SetTimer("Drift",200,1);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerEnterVehicle(playerid,vehicleid)
{
    Drifting[playerid] = 1;
    return 1;
}

public OnPlayerExitVehicle(playerid,vehicleid)
{
    Drifting[playerid] = 0;
    return 1;
}

public Drift(playerid)
{
    if(Drifting[playerid] != 0)
    {
    new Float:x,Float:y,Float:z;
        new vehicleid = GetPlayerVehicleID(playerid);
        GetPlayerPos(playerid, x, y, z);
        GetXYInFrontOfPlayer(playerid,nx,nx,10);
        tang = atan2(nx-x,ny-y);
        GetVehicleZAngle(vehicleid,ann);
        format(string,sizeof(string),"a: %.2f Ang %.2f", tang, ann);
        GameTextForPlayer(playerid, string, 100, 6);
        return 1;
    }else return 0;
}

GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;

    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);

    if (GetPlayerVehicleID(playerid)) {
      GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }

    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
Be greatfull if someone would help me, don't say " search " or give me a link to a search params , iv'e been doing it for 3 days and all iv'e found is ppl asking how to do it , just like i am .. but yeah if someone can help id'e be over the moon, actualy, scratch that, venus. ^^
Thanks
Crazy_Joe
Reply


Messages In This Thread
[Help]Drifting system - by gtalover12 - 30.03.2009, 19:58
Re: [Help]Drifting system - by FUNExtreme - 30.03.2009, 20:08
Re: [Help]Drifting system - by gtalover12 - 30.03.2009, 20:12
Re: [Help]Drifting system - by ICECOLDKILLAK8 - 30.03.2009, 20:14
Re: [Help]Drifting system - by Dujma - 30.03.2009, 20:16
Re: [Help]Drifting system - by gtalover12 - 30.03.2009, 20:19
Re: [Help]Drifting system - by Dujma - 30.03.2009, 20:28
Re: [Help]Drifting system - by gtalover12 - 30.03.2009, 20:31
Re: [Help]Drifting system - by Dujma - 30.03.2009, 20:37
Re: [Help]Drifting system - by ICECOLDKILLAK8 - 30.03.2009, 20:41

Forum Jump:


Users browsing this thread: 1 Guest(s)