Help with this script please
#1

pawn Код:
//=====INCLUDES=====//
#include <a_samp>
//===================DEFINES====================//
#define HOLDING(%0) \
    ((newkeys & (%0)) == (%0))

#define RELEASED(%0) \
    (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
//====================FORWARDS=================//
forward DstVeh(playerid);
//=============================================//
#if defined FILTERSCRIPT

public OnPlayerConnect(playerid)
{
    SetTimerEx("DstVeh",30000,true,"i",playerid);
    return 1;
}
public DstVeh(playerid)
{
    new vh=CreateVehicle(400,0.0,0.0,0.0,0.0,-1,-1,-1);
    DestroyVehicle(vh);
    new p[MAX_VEHICLES];
    for(new v = 0; v < vh; v++){
    p[v]=0;
    for(new i = 0; i < GetMaxPlayers(); i++){
    if(IsPlayerInVehicle(i,v)) p[v]=1;
}
    if(p[v]==0) DestroyVehicle(v);
}

    return 1;
}

#endif
Where is the problem in this script for destroy the vehicles ?
Reply
#2

your script destroys all vehicles up to a set vehicle number, am i reading this correctly?
Reply
#3

Why are you loading it for every player? If you have 15 players online you are loading the DstVeh 15 times and you aren't even using the playerid variable so you are wasting your resources and destroying vehicles every 30 minutes when a player joins the server (and, so it seems, never destroy that so it just keeps on adding up and up until you have this timer run every minute or even second and never able to enter a vehicle because it keeps respawning)
Reply
#4

Just give the corrected script! Okay ?! ;d
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)