Chasecar
#1

I am trying to make it and add it to my server. But I have some problems.
First of all, I cancel speedboost/flip/jump with car while someone has the Chasecar.
I have the autofix, but when I add the
pawn Код:
if( GetPlayerVehicleID(playerid) == ccar || GetPlayerVehicleID(playerid) == ccar ) return 1;
..to cancel the autofix, I can't because the
pawn Код:
undefined symbol "playerid"
And the
pawn Код:
public AutoFix()
..has no
pawn Код:
public AutoFix(playerid)
So, I can't cancel the autofix while someone is driving the Chasecar.
Secondly, I tried to make a command, that only admins can use to respawn the Chasecar if it's bugged or someone does something that is against the rules.
I added this
pawn Код:
if(!IsPlayerAdmin(playeird)) return 1; //if they're not an admin, don't let them enter
..but, it didn't work, and I should login with Rcon to respawn it.
I don't want with Rcon. I want a cmd that admins level 1+ can use to respawn the car.
And the last thing is that I have on my gamemode on the
pawn Код:
new timer;
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
//  new currentveh;
//  currentveh = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER) {
        DestroyVehicle(vehicleid);                //thats supposed to be in the timer. no slapping out
    }
//  TextDrawShowForPlayer(playerid,Cardestroyed);
//  SetTimerEx("cardestroyedhide", 5000, 0, "i", playerid);
    SetTimerEx("cardestroyedhide", 5000, 0, "i", vehicleid);
}
So when a player exit the vehicle, it disappears. Should I have this
pawn Код:
if( GetPlayerVehicleID(playerid) == ccar || GetPlayerVehicleID(playerid) == ccar ) return 1;
To cancel it, so when the player left the Chasecar not disappear?
Reply
#2


Someone help me please!
Reply
#3

Where did you forward the timer, and can you show us how? Also show us the line with SetTimer
Reply
#4

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Where did you forward the timer, and can you show us how? Also show us the line with SetTimer
I didn't forward it, only
pawn Код:
new timer;
and this
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
//  new currentveh;
//  currentveh = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER) {
        DestroyVehicle(vehicleid);                //thats supposed to be in the timer. no slapping out
    }
//  TextDrawShowForPlayer(playerid,Cardestroyed);
//  SetTimerEx("cardestroyedhide", 5000, 0, "i", playerid);
    SetTimerEx("cardestroyedhide", 5000, 0, "i", vehicleid);
}
I don't have OnGamemodeInIt any timer about
pawn Код:
SetTimerEx("cardestroyedhide", 5000, 0, "i", vehicleid);
Reply
#5

First of all:
pawn Код:
forward AutoFix(playerid);
public AutoFix(playerid)
{
//code here....
return 1;
}
Secondly:
pawn Код:
if(!IsPlayerAdmin(playerid)) return 1;
Should be
pawn Код:
if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,-1,"*You must be admin level 1!");//If the player has a lower level than 1, of course replace it with your variables!
Reply
#6

At the first, I got this error
pawn Код:
error 025: function heading differs from prototype
At the second
pawn Код:
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\filterscripts\spkadmin.pwn(1185) : error 017: undefined symbol "PInfo"
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\filterscripts\spkadmin.pwn(1185) : warning 215: expression has no effect
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\filterscripts\spkadmin.pwn(1185) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\filterscripts\spkadmin.pwn(1185) : error 029: invalid expression, assumed zero
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\filterscripts\spkadmin.pwn(1185) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#7

About the first one, search for other forwards of AutoFix and delete them.

About the second thing, I told you to replace the variables with your own. Those are just an example!
Reply
#8

So , to delete this
pawn Код:
public AutoFix()
{
    for(new i; i < MAX_PLAYERS; i++) {
        if (!IsPlayerConnected(i)) return 1;
        if (IsPlayerInAnyVehicle(i)) RepairVehicle(GetPlayerVehicleID(i));
    }
    return 1;

}
and make new.
I will try about the second tomorrow, I need to sleep now :P
Reply
#9

Here is the Timer for the Autofix
pawn Код:
public OnFilterScriptInit()
{
    print("\n--------------");
    print("Chasecar Loaded");
    print("--------------\n");

    for(new i=0; i<MAX_VEHICLES; i++)  //loop
    {
        if(i == ccar) //if i == ccar
        {
            SetVehicleNumberPlate(i, "ChaseMe"); //sets the cars number plate
            SetVehicleToRespawn(i); //respawns it (VERY IMPORTANT!!!)
        }
    }
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
        {
            SpeedBoostMultiplier[i] = 3.0;
        }
    }
    ccar = AddStaticVehicle(411,x,y,z,rot,146,146); // ccar
    SetTimer("ccc", 500, 1); //sets the timer
    SetTimer("AutoFix", 1000, true);
    return 1;
}
Here is the Autofix, it works, I have already
pawn Код:
forward Autofix
pawn Код:
forward AutoFix(playerid);
public AutoFix(playerid)
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if (!IsPlayerConnected(i)) return 1;
        if (IsPlayerInAnyVehicle(i)) RepairVehicle(GetPlayerVehicleID(i));
    }
    return 1;
}
For the speedboost I used this
pawn Код:
if( GetPlayerVehicleID(playerid) == ccar || GetPlayerVehicleID(playerid) == ccar ) return 1;
and cancel it, but it doesn't work for the Autofix
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)