13.03.2014, 01:51
pawn Код:
new Owner[128] = CarInfo[idx][cOwner]; // Why do you create a string[128] for inserting one of size 32? Also why declare this at all? Just a waste of resources. Use it directly for optimization.
GetPlayerName(playerid, name, sizeof(name));
if(Owner == name) // You need to use strcmp to compare strings, you cannot use ==. Also, you want to use != to evict them if they DON'T own the vehicle
{
SendClientMessage(playerid, COLOR_RED, "YOU DO NOT OWN THIS CAR");
// This would be a good place to use RemovePlayerFromVehicle.
return 0; // You don't want to return 0 here. Return 1.
}
pawn Код:
GetPlayerName(playerid, name, sizeof(name));
if(strcmp(CarInfo[idx][cOwner], name, false) != 0)
{
SendClientMessage(playerid, COLOR_RED, "YOU DO NOT OWN THIS CAR");
RemovePlayerFromVehicle(playerid);
return 1;
}