Jump to content

Question

Posted

cum pot face systemul/comenzile astea

/spawncar ID Color1 Color2

/despawnallcar - despawnceaza toate vehiculele create la/spawncar

/despawncar - desapwneaza doar vehiculul spawnat la /spawncar cand stai in el

COMUNITATEA MEA DE RESURSE
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spacer.png
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
www.codeup.ro / www.codeup.ro/forum

3 answers to this question

Recommended Posts

  • 0
Posted (edited)

Ok. Ceva basic, fara restrictii pe admin, ti le pui singur.

new spawnedCars[MAX_VEHICLES];
CMD:spawncar(playerid, params[]){
	new model, color1, color2;
	if(sscanf(params, "iii", model, color1, color2)) return SendClientMessage(playerid, -1, "Syntax: /spawncar [model] [color1] [color2]");
	new Float: X, Float: Y, Float: Z, Float: Angle;
	GetPlayerPos(playerid, X,Y,Z);
	GetPlayerFacingAngle(playerid,Angle);
	new car = CreateVehicle(model, X+3,Y,Z, Angle, color1, color2, -1);
	spawnedCars[car] = 1;
	return 1;
}

CMD:destroycars(playerid, params[]){
	for(new i = 0; i < MAX_VEHICLES; ++i){
    	if(spawnedCars[i] == 1){
         	spawnedCars[i] = 0;
          	DestroyVehicle(i);
        }
    }
  	return 1;
}

 

Edited by andrei9971

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.