18.09.2011, 11:32
Hi guys.
I have this code when the players state changes from onfoot to driver:
It works in the way that it only sends the message if the vehicleid == carinfo..
But, sometimes it sends
"* This [car] is owned by [owner]"
"* This is owned by ."
I don't see why it would send it twice though, second time having empty variables.
I have this code when the players state changes from onfoot to driver:
pawn Код:
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(vehicleid == CarInfo[i][ownedvehicle])
{
new vehiclename[128];
GetVehicleName(vehicleid, vehiclename, sizeof(vehiclename));
format(string, sizeof(string), "* This %s is owned by %s.", vehiclename, CarInfo[i][vOwner]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
But, sometimes it sends
"* This [car] is owned by [owner]"
"* This is owned by ."
I don't see why it would send it twice though, second time having empty variables.