SA-MP Forums Archive
Create Object - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Create Object (/showthread.php?tid=369266)



Create Object - jop9888 - 16.08.2012

Hee all,

I could use some help with a createobject, it seems so easy but it confuses me,

When i use CreateObject(8399,583.29998779,-1508.59997559,18.70000076,0.00000000,0.00000000,27 0.00000000); //object(nightclub01_lvs) (5)

in OnGameModeInit, The object creates just fine, But when i try to make a command to create the object the object isn't beeing created.

Here is the Code:

if (!strcmp("/testobj2", cmdtext))
{
Level[playerid] = (dUserINT(PlayerName(playerid)).("Level"));
if(Level[playerid] >= 5)
{
CreateObject(8399,583.29998779,-1508.59997559,18.70000076,0.00000000,0.00000000,27 0.00000000); //object(nightclub01_lvs) (5)
SendClientMessageToAll(0xFFD700AA, "Obj2 created");
}
}

Either i do get the message, what did i do wrong?

Thanks in advance,

Jop9888


Re: Create Object - Avi57 - 16.08.2012

Buddy u cant create Objects by that method !


Re: Create Object - jop9888 - 16.08.2012

Damm, how can i?


Re: Create Object - Avi57 - 16.08.2012

This include Can Help you : svText
Rep me if helped you !


Re: Create Object - jop9888 - 16.08.2012

This script allows you to spawn and control floating text (not 3D labels) text around the map and control it however you would like. This include requires your server to be running on 0.3e.

How is this include gonna create an object?..


Re: Create Object - CROSS_Hunter - 16.08.2012

pawn Код:
dcmd_object(playerid,params[])
{
   
        if(!strlen(params)) return
        SendClientMessage(playerid, COLOR_BLUE, "Usage: /object [ObjectID]") &&
        SendClientMessage(playerid, COLOR_BLUE, "Function: Will created a specified Object");

        new ObjID = strval(params), string[128];
        new Float:X, Float:Y, Float:Z, Float:Ang;
        GetPlayerPos(playerid, X, Y, Z);
        GetPlayerFacingAngle(playerid, Ang);
        X += (3 * floatsin(-Ang, degrees));
        Y += (3 * floatcos(-Ang, degrees));
        CreateObject(ObjID, X, Y, Z, 0.0, 0.0, Ang);
        format(string, sizeof(string), "{FF0080}[ADMIN] {FFFFFF}CreateObject(%d, %0.2f, %0.2f, %0.2f, 0.00, 0.00, %0.2f);", ObjID, X, Y, Z, Ang);
        format(string, sizeof(string), "{FF0080}[ADMIN] {FFFFFF}Object Created: (Id: %d) (Position: X: %0.2f, Y: %0.2f, Z: %0.2f) (Angle: %0.2f)", ObjID, X, Y, Z, Ang);
        SendClientMessage(playerid,COLOR_ADMIN, string);
return 1;
    }
if ur using dcmd then before this code write
pawn Код:
dcmd(object,6,cmdtext);
if ur using strcmptell me and i ll give code


Re: Create Object - jop9888 - 16.08.2012

Quote:
Originally Posted by CROSS_Hunter
Посмотреть сообщение
pawn Код:
dcmd_object(playerid,params[])
{
   
        if(!strlen(params)) return
        SendClientMessage(playerid, COLOR_BLUE, "Usage: /object [ObjectID]") &&
        SendClientMessage(playerid, COLOR_BLUE, "Function: Will created a specified Object");

        new ObjID = strval(params), string[128];
        new Float:X, Float:Y, Float:Z, Float:Ang;
        GetPlayerPos(playerid, X, Y, Z);
        GetPlayerFacingAngle(playerid, Ang);
        X += (3 * floatsin(-Ang, degrees));
        Y += (3 * floatcos(-Ang, degrees));
        CreateObject(ObjID, X, Y, Z, 0.0, 0.0, Ang);
        format(string, sizeof(string), "{FF0080}[ADMIN] {FFFFFF}CreateObject(%d, %0.2f, %0.2f, %0.2f, 0.00, 0.00, %0.2f);", ObjID, X, Y, Z, Ang);
        format(string, sizeof(string), "{FF0080}[ADMIN] {FFFFFF}Object Created: (Id: %d) (Position: X: %0.2f, Y: %0.2f, Z: %0.2f) (Angle: %0.2f)", ObjID, X, Y, Z, Ang);
        SendClientMessage(playerid,COLOR_ADMIN, string);
return 1;
    }
if ur using dcmd then before this code write
pawn Код:
dcmd(object,6,cmdtext);
if ur using strcmptell me and i ll give code
How does this explain why my code won't work? i appreciate your post but i would like to know the reason


Re: Create Object - [MM]RoXoR[FS] - 16.08.2012

pawn Код:
CreateObject(8399,583.29998779,-1508.59997559,18.70000076,0.00000000,0.00000000,270.00000000);
It does creates the object. I tested it myself.
Code :
pawn Код:
#include <a_samp>
#include <ZCMD>

CMD:t(playerid,params[])
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    CreateObject(8399,x,y,z,0,0,0,0);
    return 1;
}
It created object at my current location. Therefore, I was inside it and was unable to see it, but when I went outside I could see the object.


Re: Create Object - jop9888 - 20.08.2012

solved,

Reached the maximum amount of objects, now using incognito and works