Command
#1

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;
}
Reply
#2

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

and no, is bad won't work
Reply
#4

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

Edit.
Reply
#5

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

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

http://forum.sa-mp.com/index.php?topic=100530.0
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)