Using "EditObject(...);"
#1

Hello

I would like to do a command /glasses, when i write it then i get EditObject function, after when i click "Save", it saves to database, so what coords i have to save? And how can i load it when i log in.
So i want to write as less code as possible, later i want to do almost same cmd as /hat, these coords have to be saved, too.

So anyone please, thanks
Larry
Reply
#2

Use A menu (Dialog, textdraw), get the player response, On his response, create the object using CreateObject at any co-ordinates, GetPlayerPos to get his position, Make it y+0.1 or something, so that the glasses come forward, AttachObject to attach it to him, and if you are using a ini system, open the file using fopen if !fexist, and write into it using INI_WriteInt, and on player connect, load it (Read the file).

I always suggest making a basic guideline or an algorithm before scripting, because it gives you an idea of what is left to do and you don't mess up, go back and do something you forgot to do.
Anyone, correct me if I am wrong above!
Reply
#3

It is mysql, but is this the only way:

On response i have to make for Glasses these variables:
Код:
enum pInfo
{
     pObjectID,
     pBoneID,
     Float:pObject_x,
     Float:pObject_y,
     Float:pObject_z,
     Float:pObject_rx,
     Float:pObject_ry,
     Float:pObject_rz,
}
PlayerInfo[MAX_PLAYERS][pInfo];
And if i want to do the same thing with hat i have to add 8 more variables like this:

Код:
enum pInfo
{
     pObjectID,
     pBoneID,
     Float:pObject_x,
     Float:pObject_y,
     Float:pObject_z,
     Float:pObject_rx,
     Float:pObject_ry,
     Float:pObject_rz,
     pObjectID2,
     pBoneID2,
     Float:pObject_x2,
     Float:pObject_y2,
     Float:pObject_z2,
     Float:pObject_rx2,
     Float:pObject_ry2,
     Float:pObject_rz2,
}
PlayerInfo[MAX_PLAYERS][pInfo];
Or is there some shorter way?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)