Command
#8

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new veh; // Declare a resuable variable for the vehicle id
	new Float:x,Float:y,Float:z,Float:a; // Declare reusable float values for position and angle storage
	if (strcmp("/nrg", cmdtext, true, 4) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
			if(GetPlayerState(playerid) == 1) // Make sure the player is on foot
			{
				GetPlayerPos(playerid, x, y, z); // Get the player position and store it to x, y, z
				GetPlayerFacingAngle(playerid,a); // Get the player angle and store it to a
				veh = CreateVehicle(522,x,y,z,a,0,0,999999); // create an nrg at the stored positions, colored black,black, respawn time 999999
				PutPlayerInVehicle(playerid, veh, 0); // put the player in the driver seat
				SendClientMessage(playerid, COLOR_GREEN, "NRG Spawned!"); // announce the vehicle being spawned
			}
		}
		return 1;
	}
	return 0;
}
Reply


Messages In This Thread
Command - by [DSK]Vyorel - 04.05.2009, 16:23
Re: Command - by Packer5 - 04.05.2009, 16:24
Re: Command - by Joe Staff - 04.05.2009, 16:25
Re: Command - by [DSK]Vyorel - 04.05.2009, 16:30
Re: Command - by Rks25 - 04.05.2009, 16:31
Re: Command - by [DSK]Vyorel - 04.05.2009, 16:33
Re: Command - by HB - 04.05.2009, 16:41
Re: Command - by XPlatform - 04.05.2009, 19:48

Forum Jump:


Users browsing this thread: 2 Guest(s)