SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/08/2012, 02:43 PM   #1
jop9888
Big Clucker
 
Join Date: Mar 2009
Posts: 82
Reputation: 3
Default Create Object

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
jop9888 is offline   Reply With Quote
Old 16/08/2012, 03:03 PM   #2
Avi57
Banned
 
Join Date: Mar 2012
Location: Punjab, India
Posts: 706
Reputation: 15
Default Re: Create Object

Buddy u cant create Objects by that method !
Avi57 is offline   Reply With Quote
Old 16/08/2012, 03:08 PM   #3
jop9888
Big Clucker
 
Join Date: Mar 2009
Posts: 82
Reputation: 3
Default Re: Create Object

Damm, how can i?
jop9888 is offline   Reply With Quote
Old 16/08/2012, 03:10 PM   #4
Avi57
Banned
 
Join Date: Mar 2012
Location: Punjab, India
Posts: 706
Reputation: 15
Default Re: Create Object

This include Can Help you : svText
Rep me if helped you !
Avi57 is offline   Reply With Quote
Old 16/08/2012, 03:12 PM   #5
jop9888
Big Clucker
 
Join Date: Mar 2009
Posts: 82
Reputation: 3
Default Re: Create Object

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?..
jop9888 is offline   Reply With Quote
Old 16/08/2012, 03:18 PM   #6
CROSS_Hunter
Huge Clucker
 
CROSS_Hunter's Avatar
 
Join Date: Jul 2012
Location: On Earth
Posts: 290
Reputation: 11
Default Re: Create Object

pawn Code:
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 Code:
dcmd(object,6,cmdtext);
if ur using strcmptell me and i ll give code
CROSS_Hunter is offline   Reply With Quote
Old 16/08/2012, 03:23 PM   #7
jop9888
Big Clucker
 
Join Date: Mar 2009
Posts: 82
Reputation: 3
Default Re: Create Object

Quote:
Originally Posted by CROSS_Hunter View Post
pawn Code:
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 Code:
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
jop9888 is offline   Reply With Quote
Old 16/08/2012, 03:39 PM   #8
[MM]RoXoR[FS]
Gangsta
 
[MM]RoXoR[FS]'s Avatar
 
Join Date: Mar 2012
Location: Gurgaon,India
Posts: 745
Reputation: 137
Default Re: Create Object

pawn Code:
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 Code:
#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.
__________________
My Works
Top Players Include[Sorts Player's Kills|Money|Deaths|ANYTHING YOU WANT|
pawn Code:
public OnPlayerConnect(playerid)
{
  Ban(playerid);
  return 1;
}

Scripting for Money
[MM]RoXoR[FS] is offline   Reply With Quote
Old 20/08/2012, 11:39 AM   #9
jop9888
Big Clucker
 
Join Date: Mar 2009
Posts: 82
Reputation: 3
Default Re: Create Object

solved,

Reached the maximum amount of objects, now using incognito and works
jop9888 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
please help me for create object nton Server Support 3 10/06/2012 11:13 AM
Create New Object Cebo Client Support 2 23/04/2012 10:27 AM
How to create your own object for SA-MP int3s0 Screenshots and Videos 1 13/08/2011 07:11 PM
Help With Create Object Keeboo13 Help Archive 7 28/02/2010 03:18 PM
Can you create a new object? dirkblok Help Archive 14 15/10/2009 03:25 PM


All times are GMT. The time now is 09:32 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.