28.01.2012, 19:12
Okay, so, I've been setting up a few commands to place and remove some object above my car.
I would like that command work for everyone though, so everyone can place and remove (that's the most difficult part) HIS OWN objects, and not others ones.
I've done this cmd:
then I use this to put these objects on:
And this is ok. When I want to remove them I'm using this instead:
And that's on vehicle death..
The problem is: if I attach these spoilers on my car, another one attachs them and then I do /stoff, it removes his spoilers, and not mines.
All I want to know is if I can do a cmd that works with your own objects, so you remove your objects and not other ones. I think it's because of some conflicts with objects so it removes another player's objects. It happens too with my OnVehicleDeath. It happens it removes other people spoilers and not mines.
Any help?
Thanks in advance!
I would like that command work for everyone though, so everyone can place and remove (that's the most difficult part) HIS OWN objects, and not others ones.
I've done this cmd:
pawn Код:
//these are just 5 spoilers i want to attach, I'm using 40 of them at the mom, but it's just for example I've put 5 of them
new spoiler;
new spoiler2;
new spoiler3;
new spoiler4;
new spoiler5;
pawn Код:
if(strcmp("/ston",cmdtext,true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You have to be the driver.");
}
else if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
spoiler = CreateObject(1000,0,0,0,0,0,0);
spoiler2 = CreateObject(1000,0,0,0,0,0,0);
spoiler3 = CreateObject(1000,0,0,0,0,0,0);
spoiler4 = CreateObject(1000,0,0,0,0,0,0);
spoiler5 = CreateObject(1000,0,0,0,0,0,0);
AttachObjectToVehicle(spoiler, vehicleid, 0.000000, -2.420007, -0.399999, 0.000000, 0.000000, 0.000000); //Object Model: 1000 |
AttachObjectToVehicle(spoiler2, vehicleid, 0.000000, -2.420007, -0.339999, 0.000000, 0.000000, 0.000000); //Object Model: 1000 |
AttachObjectToVehicle(spoiler3, vehicleid, 0.000000, -2.420007, -0.284999, 0.000000, 0.000000, 0.000000); //Object Model: 1000 |
AttachObjectToVehicle(spoiler4, vehicleid, 0.000000, -2.420007, -0.224999, 0.000000, 0.000000, 0.000000); //Object Model: 1000 |
AttachObjectToVehicle(spoiler5, vehicleid, 0.000000, -2.420007, -0.169999, 0.000000, 0.000000, 0.000000); //Object Model: 1000 |
}
return 1;
}
pawn Код:
if(strcmp(cmdtext, "/stoff", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You have to be the driver.");
}
else if(IsPlayerInAnyVehicle(playerid))
{
DestroyObject(spoiler);
DestroyObject(spoiler2);
DestroyObject(spoiler3);
DestroyObject(spoiler4);
DestroyObject(spoiler5);
}
return 1;
}
pawn Код:
public OnVehicleDeath(vehicleid)
{
DestroyObject(spoiler);
DestroyObject(spoiler2);
DestroyObject(spoiler3);
DestroyObject(spoiler4);
DestroyObject(spoiler5);
return 1;
}
All I want to know is if I can do a cmd that works with your own objects, so you remove your objects and not other ones. I think it's because of some conflicts with objects so it removes another player's objects. It happens too with my OnVehicleDeath. It happens it removes other people spoilers and not mines.
Any help?
Thanks in advance!