How to do this, loops, functions
#1

How can I make a function out of this.

pvehicle[i] is the id of the vehicle, the way the vehicle is saved, example.

VehicleInfo[pvehicle[i]][vPlate];

And this is the test command
PHP код:
CMD:testcar(playeridparams[])
{
    new 
string[200];
    for(new 
iMAX_PVEHICLESi++)
    {
        
format(stringsizeof(string), "Vehicle ID: %d | Vehicle Type: %d, Plate: %s | Owner: %s"VehicleInfo[pvehicle[i]][ID], VehicleInfo[pvehicle[i]][vType], VehicleInfo[pvehicle[i]][vPlate], VehicleInfo[pvehicle[i]][vOwner] );
        
SCM(playeridCOLOR_YELLOWstring);
        break;
    }
    return 
1;

But how can I make this like.. not show 200 times also, can I make a function or something out of this so I don't have to make a loop everywhere I need the vehicle id?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)