Function question
#5

Hmm, so like this?

pawn Код:
new Antiboost[MAX_PLAYERS]






                 public OnPlayerConnect(playerid)
                   {

                     Antiboost[playerid] = 0;

//Rest of my GM lines

    OnPlayerKeyStateChange
    {

    new Keys,up,down;
    GetPlayerKeys(playerid,Keys,up,down);
    new Float:x,Float:y,Float:z;
    if (PRESSED(KEY_CROUCH)){
    {
    if(Antiboost[playerid] == 0)
    {
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);SetVehicleVelocity(GetPlayerVehicleID(playerid),x ,y ,z+0.3);}}}



and in the racescript:


pawn Код:
CallRemoteFunction("Antiboost","ii",playerid,1);    //On top of the script


//Startrace cmd

CMD:startrace(playerid, params[])
{

    if(AutomaticRace == true) return SendClientMessage(playerid, RED, "<!> Not possible. Automatic race is enabled!");
    if(BuildRace != 0) return SendClientMessage(playerid, RED, "<!> There's someone building a race!");
    if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> There's a race currently. Wait first till race ends!");
    if(isnull(params)) return SendClientMessage(playerid, RED, "<!> /startrace [racename]");
    Antiboost[playerid] = 0;
    LoadRace(playerid, params);
    return 1;
}

Like this?
Reply


Messages In This Thread
Function question - by knackworst - 28.11.2010, 09:48
Re: Function question - by iggy1 - 28.11.2010, 09:54
Re: Function question - by XePloiT - 28.11.2010, 09:54
Re: Function question - by JaTochNietDan - 28.11.2010, 09:58
Re: Function question - by knackworst - 28.11.2010, 10:12
Re: Function question - by iggy1 - 28.11.2010, 10:16
Re: Function question - by knackworst - 28.11.2010, 10:22
Re: Function question - by JaTochNietDan - 28.11.2010, 10:26
Re: Function question - by knackworst - 28.11.2010, 10:34
Re: Function question - by JaTochNietDan - 28.11.2010, 10:38

Forum Jump:


Users browsing this thread: 1 Guest(s)