01.07.2014, 14:25
Hello!
Well, I have created a vehicle buy system and all is Ok.
But when someone enter in vehicle that is of another player, I want to send a message to vehicle's owner and a message to the thief.
My variable for assign an ID to the vehicle of player is:
And I have a bool too:
When the player buy the vehicle:
So, I need a code that when a player enter a vehicle, identify if this vehicle is of another player and, if is, send a message to the thief and to the vehicle's owner.
By the logic, is something like:
I'm having problem sending the messages. How to get the ID of the thief and send a message to him and for the vehicle owner?
Thanks all in advance!
Well, I have created a vehicle buy system and all is Ok.
But when someone enter in vehicle that is of another player, I want to send a message to vehicle's owner and a message to the thief.
My variable for assign an ID to the vehicle of player is:
pawn Код:
bought_vehicle[MAX_PLAYERS];
pawn Код:
new bool:boughtveh[MAX_PLAYERS];
pawn Код:
bought_vehicle[playerid] = CreateVehicle(bla, bla, bla, bla, bla);
boughtveh[playerid] = true;
By the logic, is something like:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid != bought_vehicle[playerid]) return SendClientMessage(playerid, red, "This vehicle is not yours!");
return 1;
}
Thanks all in advance!