Spawning any object in game
#8

This is how the script looks right now but still doesn't work, it compiles, but when I am in game and type /object nothing will appear. Not even the client message.

Код:
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, "i", ObjectModel)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /object <ObjectModel>");
            GetPlayerPos(playerid, plocx, plocy, plocz);
            GetPlayerFacingAngle(playerid,ploca);
            ObjID = CreateObject(ObjectModel, plocx, plocy, plocz, 0.0, 0.0, 0.0, 5.0);
            // 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, plocx, plocy, plocz);
            SendClientMessage(playerid, 0x00FF00FF, Msg);
		}
		else
		    return 0;
	}
	else
	    return 0;

	return 1;
}
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)