21.11.2011, 14:52
I want to check if owner name is the same as player name but im getting an error there, any ideas?
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
new file[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Cars/%s.ini",name);
if(dini_Exists(file))
{
new owner[24];
new veh = GetPlayerVehicleID(playerid);
GetPlayerName(OwnerID[veh], owner, sizeof(owner));
if(owner == name) // THIS LINE
{
SendClientMessage(playerid, COLOR_ORANGE, "Just to test this script (THIS IS YOUR CAR).");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "Just to test this script (NOT YOUR CAR).");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}