SA-MP Forums Archive
Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Command (/showthread.php?tid=76445)



Command - [DSK]Vyorel - 04.05.2009

is good? will work?

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/nrg", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
GetVehiclePos(522, X, Y, Z); //NRG
//GetPlayerVehicleID(522, X, Y, Z)playerid;
SendClientMessage(playerid, COLOR_GREEN, "NRG Spawnat!");
}
return 1;
}
return 0;
}


Re: Command - Packer5 - 04.05.2009

I think that if you open 3 { then you must close 3 }


Re: Command - Joe Staff - 04.05.2009

and no, is bad won't work


Re: Command - [DSK]Vyorel - 04.05.2009

Quote:
Originally Posted by Packer5
I think that if you open 3 { then you must close 3 }
Sorry!

Edit.


Re: Command - Rks25 - 04.05.2009

No won't work, you have to create it.


Re: Command - [DSK]Vyorel - 04.05.2009

Quote:
Originally Posted by RKS_
No won't work, you have to create it.
How?


Re: Command - HB - 04.05.2009

http://forum.sa-mp.com/index.php?topic=100530.0


Re: Command - XPlatform - 04.05.2009

Код:
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;
}