Create Object
#1

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
Reply
#2

Buddy u cant create Objects by that method !
Reply
#3

Damm, how can i?
Reply
#4

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

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?..
Reply
#6

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
Reply
#7

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
Reply
#8

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.
Reply
#9

solved,

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


Forum Jump:


Users browsing this thread: 1 Guest(s)