Originally Posted by Compton's Eazy E
Line?
|
Originally Posted by arie9000nerd
Hi!
![]() i got a server.... a stunt server.... but my players always got a question if there is an option to spawn a car.... so, i tryed to make an script...to spawn a car if u typ: /nrg.... BUT I GOT 9 ERRORS IN ONE LINE!! ![]() ![]() ![]() ![]() ![]() can somebody help me making a simple script with a command: /nrg and then you get an nrg? thanx! XD oh, and btw, sory for my bad english....:P |
if (strcmp("/nrg", cmdtext, true, 10) == 0)
{
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
AddStaticVehicle(522,x+2,y,z,a,1,1);
SendClientMessage(playerid,0x21DD00FF,"You spawned a NRG-500");
return 1;
}
SpawnVehicle(playerid, vehicleid)
{
new Float:X, Float:Y, Float:Z, Float:A; //Stores your position and Angle
new Vehicle;
GetPlayerPos(playerid, X, Y, Z); //Gets your Position
GetPlayerFacingAngle(playerid, A); //Gets your Angle
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xF60000AA, "You have to be on foot to use this command!");
Vehicle = CreateVehicle(vehicleid, X, Y, Z, A, 1, 169, -1); //Creates vehicle
PutPlayerInVehicle(playerid, Vehicle, 0); //Puts you in the vehicle
return 1;
}
if(strcmp("/nrg", cmdtext, true, 10) == 0)
{
SpawnVehicle(playerid, 522); //This creates an nrg and puts you in it.. ;D
SendClientMessage(playerid, 0xF60000AA, "Your brand new nrg successfully spawned. :D");
return 1;
}
if(strcmp("/infernus", cmdtext, true, 10) == 0)
{
SpawnVehicle(playerid, 411); //You just need to change the 411 to vehicle you want to spawn. in this case you will spawn infernus.
SendClientMessage(playerid, 0xF60000AA, "Your brand new infernus successfully spawned. :D");
return 1;
}