04.05.2009, 19:48
Код:
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; }