24.06.2011, 21:10
So, what parameters are you using in the attach object command?
like Object ID, Bone ID, Positions, Rotations etc...
Simple Example:
In your attach command:
In OnPlayerDisconnect:
In OnPlayerSpawn:
There are many other sophisticated/better methods. This is just a basic example.
(Everything is UNTESTED Here!)
like Object ID, Bone ID, Positions, Rotations etc...
Simple Example:
In your attach command:
pawn Код:
SetPVarInt(playerid, "object", objectid); // objectid = the one you entered in the cmd. if you did /hold 1337, then objectid = 1337
pawn Код:
new pname[MAX_PLAYER_NAME], objectid, string[30], string2[10];
GetPlayerName(playerid,pname,sizeof(pname);
objectid = GetPVarInt(playerid, "object");
format(string,30,"%s.txt",pname);
format(string2,10,"%i",objectid);
new File:pobject=fopen(string, io_write);
fwrite(pobject, string2);
fclose(pobject);
SetPVarInt(playerid, "object", 0)
pawn Код:
new pname[MAX_PLAYER_NAME],string[30];
GetPlayerName(playerid,pname,sizeof(pname);
format(string,30,"%s.txt",pname);
if(fexist(string)
{
new File:pobject=fopen(string, io_read);
new objectid[10];
fread(pobject, objectid, sizeof(objectid), false);
fclose(pobject);
SetPlayerAttachedObject(strval(objectid),....................
}
(Everything is UNTESTED Here!)