16.09.2011, 03:58
Hey guys.
So I'm having trouble with this code, that Jeffrey made for me. It's meant to loop through, see if the two strings match anywhere then return the ID of where they matched.
It keeps returning ID 1 though.
So I'm having trouble with this code, that Jeffrey made for me. It's meant to loop through, see if the two strings match anywhere then return the ID of where they matched.
pawn Код:
stock GetCarIDFromPlayer(playerid)
{
new PlayersName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayersName, MAX_PLAYER_NAME);
for(new i=0; i<sizeof(CarInfo); i++)
{
if(!strcmp(CarInfo[i][vOwner], PlayersName)) return i; //Returns the Vehicle ID
}
return -1;
}