14.10.2014, 16:32
Code:
new iVehicleID = GetPlayerVehicleID(playerid), iMsg[120]; if(OwnedVeh(iVehicleID) != 0) { if(strmatch(vInfo[OwnedVeh(iVehicleID)][vOwner], "Unbought")) { format(iMsg, sizeof(iMsg), "Hello do you want buy this vehicle?\nCost: %iЂ", vInfo[OwnedVeh(iVehicleID)][vPrice]); ShowPlayerDialog(playerid, 50000, DIALOG_STYLE_MSGBOX, "Vehicle buy", iMsg, "Yes", "No"); //TogglePlayerControllable(playerid, false); } else if(strmatch(vInfo[OwnedVeh(iVehicleID)][vOwner], pName(playerid))) { format(iMsg, sizeof(iMsg), "Vehicle control [Numpad 4]"); SendClientMessage(playerid, COLOR_RED, iMsg); } else if(strmatch(vInfo[OwnedVeh(iVehicleID)][vOwner], pName(playerid)) || vInfo[OwnedVeh(iVehicleID)][vLocked] == 1) { format(iMsg, sizeof(iMsg), "This car is locked. Vehicle owner %s!", vInfo[OwnedVeh(iVehicleID)][vOwner]); SendClientMessage(playerid, -1, iMsg); RemovePlayerFromVehicle(playerid); } else if(strmatch(vInfo[OwnedVeh(iVehicleID)][vOwner], pName(playerid)) || vInfo[OwnedVeh(iVehicleID)][vLocked] == 0) { format(iMsg, sizeof(iMsg), "This car is not locked. Vehicle owner %s", vInfo[OwnedVeh(iVehicleID)][vOwner]); SendClientMessage(playerid, -1, iMsg); } else { format(iMsg, sizeof(iMsg), "Vehicle owner: %s", vInfo[OwnedVeh(iVehicleID)][vOwner]); SendClientMessage(playerid, -1, iMsg); RemovePlayerFromVehicle(playerid); } }
Code:
stock strmatch(const String1[], const String2[]) { if ((strcmp(String1, String2, true, strlen(String2)) == 0) && (strlen(String2) == strlen(String1))) { return true; } else { return false; } }