20.01.2013, 09:39
Quote:
I want to check if the ownersname currently connected is = to the vehicle data's owner
the problem is it's sending an error: 1. Array must be indexed(Variablewnername) 2. Empty Statement Being a noob an' all, I do not know how to compare two strings if they're the same, I could use strcmp but I'm still stucked like one happened up top. |
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new ownername[MAX_PLAYER_NAME];
GetPlayerName(playerid, ownername, sizeof(ownername));
if(strcmp(ownername, AVehicleData[vehicleid][Owner], true) == 0)
{
new string[128];
format(string,sizeof(string), "You are the owner of this vehicle");
SendClientMessage(playerid, 0x0FF0000AA, string);
}
return 1;
}