Jump to content

Recommended Posts

Posted (edited)

Adaugi in gamemode comanda urmatoare.

 

CMD:spawncar(playerid, params[])
{
	// aici faci verificarea daca are admin (nu stiu cum ai tu numele variabilelor dar banuiesc ca stii sa editezi).
	if(playerVariables[playerid][pAdminLevel] < 1) return 1;

	// in caz ca nu ai is_null definita, adauga asta la inceputul scriptului: #define is_null(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
	if(is_null(params)) return SendClientMessage(playerid, -1, "Syntax: /spawncar [vehicleid]");
	new model = strval(params);

	if(model < 400 || model > 611) return SendClientMessage(playerid, -1, "Valid car IDs start at 400, and end at 611.");

	new Float:my_pos[4];
	GetPlayerPos(playerid, my_pos[0], my_pos[1], my_pos[2]);
	GetPlayerFacingAngle(playerid, my_pos[3]);

	new v = CreateVehicle(model, my_pos[0], my_pos[1], my_pos[2], my_pos[3], random(256), random(256), 0, 0);
	if(v == INVALID_VEHICLE_ID)
	{
		SendClientMessage(playerid, -1, "Sunt prea multe masini pe server [ERROR].");
		return 1;
	}

	PutPlayerInVehicle(playerid, v, 0);
	
	new text[100];
	format(text, sizeof(text), "Ai spawnat masina cu modelul %d.", model);
	SendClientMessage(playerid, -1, text);

	return 1;
}

 

Edited by RedGun
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. 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.