Spawning any object in game
#1

First of all I should let you know that I am not good at scripting, this is kinda what I've done and I'd need some help, I want a command that spawns any object in game.

Код:
COMMAND:object(playerid, params[])
{
        // Setup local variables
	new ObjectModel, ObjID, Msg[128], Float:plocx,Float:plocy,Float:plocz,Float:ploca

	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Check if the player's admin-level is at least 5
		if (APlayerData[playerid][PlayerLevel] >= 5)
		{
			if (sscanf(params, "iffff", ObjectModel, Float:plocx,Float:plocy,Float:plocz,Float:ploca)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/object <ObjectModel>\"");
			else
			{
				
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                ObjID = CreateObject(ObjectModel, Float:plocx,Float:plocy,Float:plocz,Float:ploca);
				// Inform the player about it
				format(Msg, 128, "You spawned object-id %i (model-id = %i) at coords: x=%4.2f, y=%4.2f, z=%4.2f", ObjID, ObjectModel, x, y, z);
				SendClientMessage(playerid, 0x00FF00FF, Msg);
			}
		}
		else
		    return 0;
	}
	else
	    return 0;

	
	return 1;
}
Errors:

Код:
(14181) : error 001: expected token: ";", but found "if"
(14192) : warning 202: number of arguments does not match definition
(14192) : warning 202: number of arguments does not match definition
(14194) : error 017: undefined symbol "x"
Please, give me some help, I'd appreciate it.
Reply


Messages In This Thread
Spawning any object in game - by Jhony_Blaze - 29.11.2014, 20:38
Re: Spawning any object in game - by Pottus - 29.11.2014, 20:43
Re: Spawning any object in game - by JeaSon - 29.11.2014, 20:44
Re: Spawning any object in game - by Jhony_Blaze - 29.11.2014, 21:02
Re: Spawning any object in game - by JeaSon - 29.11.2014, 21:09
Re: Spawning any object in game - by Jhony_Blaze - 29.11.2014, 21:33
Re: Spawning any object in game - by JeaSon - 29.11.2014, 21:48
Re: Spawning any object in game - by Jhony_Blaze - 29.11.2014, 22:18
Re: Spawning any object in game - by JeaSon - 29.11.2014, 22:21
Re: Spawning any object in game - by Threshold - 29.11.2014, 22:56

Forum Jump:


Users browsing this thread: 1 Guest(s)