16.05.2015, 14:24
Quote:
hello, i used the filescript to create boxes using (ivo) AttachObjectToVehicle
when the player type / pbox......2 player is more work together giving the same command while delivering the box, it disappears from the first that took and buga, how do I not give bug? example: pawn Код:
|
PHP код:
if (PlayerW [playerid] [Work] == box) {
box1 = CreateObject(id, 0,0, -1000,0,0,0,100); // ID that be? you declared new box1, box2;?
box2 = CreateObject(id, 0,0, -1000,0,0,0,100); // If you specify a floating-point better to write it as well
AttachObjectToVehicle (box1, GetPlayerVehicleID (playerid), 0.000000, -0.750000,0.300000,0.000000,0.000000,89.099983);
AttachObjectToVehicle (box2, GetPlayerVehicleID (playerid), 0.075000, -0.750000,0.449999,0.000000,0.000000,89.099983);
SetPlayerMapIcon (playerid, 37 1324.5773,286.8284,20.0452, 17, 0, MAPICON_GLOBAL);
tbox [playerid] = 1;
PHP код:
#define MAX_MSG_SIZE (256)
public OnPlayerCommandText(playerid, cmdtext[])
{
new msg[MAX_MSG_SIZE];
if (strcmp("/mbox", cmdtext, true, 10) == 0)
{
if (IsPlayerInAnyVehicle(playerid)) {
new vehicleid = GetPlayerVehicleID(playerid);
new box1 = CreateObject(19832, 0.0,0.0,0.0, 0.0,0.0,0.0, 100.0);
new box2 = CreateObject(19832, 0.0,0.0,0.0, 0.0,0.0,0.0, 100.0);
AttachObjectToVehicle(box1, vehicleid, 0.000000,-0.750000,0.300000, 0.000000,0.000000,89.099983);
AttachObjectToVehicle(box2, vehicleid, 0.075000,-0.750000,0.449999, 0.000000,0.000000,89.099983);
SetPlayerMapIcon(playerid, 37, 1324.5773,286.8284,20.0452, 17, 0, MAPICON_GLOBAL);
format(msg, MAX_MSG_SIZE, "MBox: box1 (%d), box2 (%d) created and attached vehicle (%d)", box1, box2,vehicleid);
SendClientMessage(playerid, 0x00FF00FF, msg);
} else {
SendClientMessage(playerid, 0xFF0000FF, "You not in car!");
}
return 1;
}
return 0;
}