Script doesn't execute a sendclientmessage
#7

Run time error 4 for accessing negative index (-400) because the vehicle does not exist and you are trying to retrieve its name.

Since the vehicle ID is index for the vehicle array, you do not need to loop 2000 times - use the vehicle pools:
pawn Код:
for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++)
{
    if (!GetVehicleModel(i)) continue; // if the vehicle does not exist, skip the iterator
    if(!strcmp(Vehicle[i][vOwner], Name(playerid), false))
    {
        ...
    }
}
Reply


Messages In This Thread
Script doesn't execute a sendclientmessage - by justjamie - 13.08.2016, 09:46
Re: Script doesn't execute a sendclientmessage - by Vince - 13.08.2016, 10:10
Re: Script doesn't execute a sendclientmessage - by justjamie - 13.08.2016, 10:11
Re: Script doesn't execute a sendclientmessage - by Vince - 13.08.2016, 10:13
Re: Script doesn't execute a sendclientmessage - by justjamie - 13.08.2016, 10:14
Re: Script doesn't execute a sendclientmessage - by Shinja - 13.08.2016, 12:30
Re: Script doesn't execute a sendclientmessage - by Konstantinos - 13.08.2016, 12:54

Forum Jump:


Users browsing this thread: 1 Guest(s)