11.02.2019, 21:24
I have this code to check if the vehicle is of the owner:
It works perfectly but i've a "problem". Is there a way to shorten this?
Since i have some vehicle related commands restriced only for vehicle owners, it's damn ugly and stupid write everytime this long code to check it.
I wanna do something like:
if(VehicleOwner(playerid) return "You're owner of this vehicle".
Hope i was clear, thanks.
pawn Код:
foreach(new i : PrivateVehicles[playerid])
{
if(!strcmp(vInfo[i][vehOwner], ReturnPlayerName(playerid)))
//This vehicle is yours
}
}
Since i have some vehicle related commands restriced only for vehicle owners, it's damn ugly and stupid write everytime this long code to check it.
I wanna do something like:
if(VehicleOwner(playerid) return "You're owner of this vehicle".
Hope i was clear, thanks.